如何解决我的接入微软翻译中,实时语音翻译中,出错问题是,返回的翻译还是我原始的声音

glkj 0 信誉分
2025-11-24T07:03:55.8766667+00:00

 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

// 只能获取到说话者声音, 无法获取到翻译后的声音(比如我说中文, 合成后的声音就是中文, 无法翻译合成英文)
}

社区中心 | 未监视
0 个注释 无注释
{count} 票

你的答案

提问者可以将答案标记为“已接受”,版主可以将答案标记为“已推荐”,这有助于用户了解答案是否解决了提问者的问题。