【问题标题】:How to get all available Sounds file listed in system settings in iOS如何获取 iOS 系统设置中列出的所有可用声音文件
【发布时间】:2018-08-31 05:13:53
【问题描述】:

我想显示一个选择器视图或所有可用电话声音的列表。这样用户就可以更改应用程序的声音警报(它不会影响系统声音文件)。

其中一项应用功能将允许用户仅在应用内播放选定的声音。

如果有任何方法可以执行此操作,请告诉我。

谢谢!任何帮助将不胜感激。

【问题讨论】:

    标签: ios iphone swift audio


    【解决方案1】:
    1. 您可以使用系统声音服务播放短片(30 秒或 更短)的声音。界面不提供水平、定位、 循环,或定时控制,不支持同时 播放:一次只能播放一种声音。 苹果系统声音服务链接 https://developer.apple.com/documentation/audiotoolbox/system_sound_services

          // import this
          import AVFoundation
      
          // create a sound ID, in this case its the tweet sound.
          let systemSoundID: SystemSoundID = 1016
      
          // to play sound
          AudioServicesPlaySystemSound (systemSoundID)
      

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-09-11
    • 2016-05-31
    • 1970-01-01
    • 1970-01-01
    • 2011-11-07
    • 2018-11-16
    • 2016-09-22
    相关资源
    最近更新 更多