问题
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).
回答1:
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.
let AVAudioSessionModeMeasurement: String
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.
来源:https://stackoverflow.com/questions/45155648/avaudiosessions-playandrecord-category-and-avaudiosessionmodemeasurement-are-in