Browse Source

修复tts奔溃问题9.28

newdev_shunjiawei
fdp 1 year ago
parent
commit
983fe12b4f
  1. 2
      local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/AzureTtsHelper.swift
  2. 4
      local_plugins/azure_speech/ios/azure_speech/Sources/tools/SimpleAudioReceiver.swift

2
local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/AzureTtsHelper.swift

@ -291,7 +291,7 @@ public class AzureTtsHelper: NSObject, ITtsService {
synthesisQueue.async {
do {
self.synthesizer = nil
// self.synthesizer = nil
try self.recreateSynthesizer()
}catch {
os_log("重置语音合成失败: %{public}@", log: self.log, type: .error, error.localizedDescription)

4
local_plugins/azure_speech/ios/azure_speech/Sources/tools/SimpleAudioReceiver.swift

@ -264,8 +264,8 @@ public class SimpleAudioReceiver: NSObject {
// 非通话:保持原有逻辑,但使用 .allowBluetooth 以支持录音(而不是 A2DP)
desiredCategory = .playAndRecord
desiredMode = .videoChat
//desiredOptions = [.allowBluetooth, .mixWithOthers, .defaultToSpeaker]
desiredOptions = [.mixWithOthers, .defaultToSpeaker]
desiredOptions = [.allowBluetooth, .mixWithOthers, .defaultToSpeaker]
//desiredOptions = [.mixWithOthers, .defaultToSpeaker]
}
// 仅在类别或模式变化时才调用 setCategory,避免触发不必要的 categoryChange

Loading…
Cancel
Save