问题描述
尝试使用AVAudioSessionModeMeasurement
模式将AVAudioSession
放入.playAndRecord
类别会导致.defaultToSpeaker
选项被忽略,导致输出在听筒(也称为接收器)中安静地播放.
Attempting to put AVAudioSession
into the .playAndRecord
category with the AVAudioSessionModeMeasurement
mode causes the .defaultToSpeaker
option to be ignored, resulting in output being played quietly out the earpiece (also known as the receiver).
推荐答案
虽然关于这方面的文字似乎不多,但文档使这种将音频输出发送到接收器而不是扬声器的最终结果"看起来像可能的预期行为,而不是错误.
While there doesn't seem to be much written about this the documentation makes this "end result of audio output being sent to the receiver rather than speaker" seem like possible intended behavior and not a bug.
此模式适用于需要最小化 系统提供的信号处理功能,用于输入和输出信号.如果 在具有多个内置麦克风的设备上录音, 使用主麦克风.
This mode is intended for apps that need to minimize the amount of system-supplied signal processing to input and output signals. If recording on devices with more than one built-in microphone, the primary microphone is used.
这篇关于AVAudioSession的PlayAndRecord类别和AVAudioSessionModeMeasurement与defaultToSpeaker选项不兼容吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!