-
Notifications
You must be signed in to change notification settings - Fork 2
Audio
AVAudioSession音频相关API。
游戏音频中断与恢复事件。
玩家音频设备变更事件。
设置AVAudioSession的激活状态 。
- 返回值:是否成功抢占音频优先权
设置系统铃声时是否中断Audio Session。
Beginning in iOS 14, users can set a global preference that indicates whether the system displays incoming calls using a banner or a > full-screen display style. If using the banner style, setting this value to true prevents the system from interrupting the audio session with incoming call notifications, and gives the user an opportunity to accept or decline the call. The system only interrupts the audio session if the user accepts the call.
Enabling this preference can improve the user experience of apps with audio sessions that you don’t want to interrupt, such as those that record audiovisual media or that you use for music performance.
This preference has no effect if the device uses the full-screen display style—the system interrupts the audio session on incoming calls.
当前AudioSession是否被中断(游戏处于后台时无法更新状态,可能导致结果不准确)。
当前系统音量。
https://developer.apple.com/documentation/avfaudio/avaudiosession/1616533-outputvolume?language=objc
- 返回值:音量(0-1)
音频输入延迟。
- 返回值:延迟(秒)
音频输出延迟。
- 返回值:延迟(秒)
音频采样率。
- 返回值:采样率(Hertz)
判断玩家当前是否连接了蓝牙耳机。
调用此方法可静音/暂停设备后台正在播放的音频。
本Wiki包含插件中各个类各个方法的详细介绍,内容可能不完整,尚待补全。如果代码有问题,本人欢迎各位提交Issue以及PR。Wiki内容以最新版本为准。