|
|
|
@ -561,7 +561,7 @@ private func convertAudioBuffer(_ buffer: AVAudioPCMBuffer, to targetFormat: AVA |
|
|
|
* @throws 音频会话配置失败时抛出错误 |
|
|
|
*/ |
|
|
|
private func setupAudioSession() throws { |
|
|
|
try audioSession.setCategory(.playAndRecord, mode: .default, options: [.defaultToSpeaker, .allowBluetooth]) |
|
|
|
try audioSession.setCategory(.playAndRecord, mode: .default, options: [.defaultToSpeaker, .allowBluetooth,.mixWithOthers]) |
|
|
|
try audioSession.setActive(true) |
|
|
|
|
|
|
|
// // 设置首选的音频参数 - 修改为16000Hz以匹配Azure Speech要求 |
|
|
|
|