我已经在网页上实现了聊天,并可以通过Azure语音API使用语音转文本。它可以正常工作,但是我不知道在哪里可以设置API可以理解的语言。 我希望它能听懂法语,但是当我用法语讲话时,它会以英语单词抄写,并带有熟悉的声音。 如何/在哪里设置语言? 我明确指出,我不是在Azure仪表板上设置服务的人。
答案 0 :(得分:1)
有一个locale
参数,可以像下面的example一样使用:
export interface ICognitiveServicesSpeechRecognizerProperties {
locale?: string,
subscriptionKey?: string,
fetchCallback?: (authFetchEventId: string) => Promise<string>,
fetchOnExpiryCallback?: (authFetchEventId: string) => Promise<string>
}
如果不提供值,则使用以下example:
const locale = properties.locale || 'en-US';
您可以找到这些参数here的可能值
答案 1 :(得分:0)