有没有办法以编程方式列出Azure Text to Speech中的可用声音?
我进行了广泛的搜索,找到了这个页面https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/language-support
但是我还没有找到通过编程获取这些信息的方法--这是可能的吗?
发布于 2020-03-27 23:37:20
有一个voices/list端点,它被记录在here中。
文档中的示例:
GET /cognitiveservices/voices/list HTTP/1.1
Host: westus.tts.speech.microsoft.com
Authorization: Bearer [Base64 access_token]发布于 2019-02-25 09:34:35
根据swagger中提到的documentation,您可以使用
api/languagegeneration/v2.0/Endpoints/locales获取受支持的区域设置的端点。
/api/texttospeech/v2.0/datasets/locales发布于 2021-08-15 10:20:17
从1.16.0开始有...
SpeechSynthesizer.GetVoicesAsync(string locale)
var config = SpeechConfig.FromSubscription("YourSubscriptionKey", "YourServiceRegion");
using var synthesizer = new SpeechSynthesizer(config, null as AudioConfig);
using var result = await synthesizer.GetVoicesAsync();
if (result.Reason == ResultReason.VoicesListRetrieved)
{
Debug.WriteLine($"Found {result.Voices.Count} voices");
}在Azure-Samples github存储库中有一个有效的示例SynthesisGetAvailableVoicesAsync()方法...在Text-to-speech quickstart页面的顶部有一个指向文本到语音转换示例的直接链接。
https://stackoverflow.com/questions/54858307
复制相似问题