|
|
|
@ -98,11 +98,11 @@ public class AzureAsrHelper: NSObject { |
|
|
|
} |
|
|
|
|
|
|
|
// 创建语音配置 |
|
|
|
speechConfig = try SPXSpeechConfiguration(subscription: subscriptionKey, region: region) |
|
|
|
speechConfig = try SPXSpeechConfiguration(subscription: subscriptionKey, region: region) |
|
|
|
// 针对翻译场景的性能优化 |
|
|
|
// optimizeForTranslation() |
|
|
|
if isAutoDetectLanguage { |
|
|
|
speechConfig?.setPropertyTo("Continuous", byName: "SpeechServiceConnection_LanguageIdMode") |
|
|
|
speechConfig?.setPropertyTo("Continuous", by: SPXPropertyId.speechServiceConnectionLanguageIdMode) |
|
|
|
// 不在这里设置语言,让SPXAutoDetectSourceLanguageConfiguration处理 |
|
|
|
os_log("启用语言检测模式,支持语言: %{public}@", log: log, type: .info, supportedLanguages.joined(separator: ",")) |
|
|
|
} else { |
|
|
|
|