如何解决我的接入微软翻译中,实时语音翻译中,出错问题是,返回的翻译还是我原始的声音
speechConfig?.setSpeechSynthesisOutputFormat(.raw16Khz16BitMonoPcm)
speechConfig?.setPropertyTo("Continuous", by: .speechServiceConnectionLanguageIdMode)
speechConfig?.setPropertyTo("2000", by: .speechSegmentationSilenceTimeoutMs)
autoTransReco = try? SPXTranslationRecognizer(speechTranslationConfiguration: speechConfig!, autoDetectSourceLanguageConfiguration: autoDetectConfig!, audioConfiguration: ac1!)
autoTransReco?.addTargetLanguage(leftLan.translators_language_code!)
autoTransReco?.addTargetLanguage(rightLan.translators_language_code!)
autoTransReco?.addRecognizedEventHandler {[weak self] _, evt __in
// 能正常显示文本翻译
}
__ autoTransReco?.addSynthesizingEventHandler {[weak self] _, arg in
// 只能获取到说话者声音, 无法获取到翻译后的声音(比如我说中文, 合成后的声音就是中文, 无法翻译合成英文)
}