mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2025-12-19 05:47:46 +00:00
fix microsoft fetch list voice from hardcode westus region (#459)
This commit is contained in:
@@ -822,9 +822,10 @@ async function getLanguagesVoicesForAws(credential, getTtsVoices, logger) {
|
||||
|
||||
async function getLanguagesVoicesForMicrosoft(credential, getTtsVoices, logger) {
|
||||
if (credential) {
|
||||
const response = await fetch('https://westus.tts.speech.microsoft.com/cognitiveservices/voices/list', {
|
||||
const {region, api_key} = credential;
|
||||
const response = await fetch(`https://${region}.tts.speech.microsoft.com/cognitiveservices/voices/list`, {
|
||||
headers: {
|
||||
'Ocp-Apim-Subscription-Key': credential.api_key
|
||||
'Ocp-Apim-Subscription-Key': api_key
|
||||
}
|
||||
});
|
||||
if (!response.ok) {
|
||||
|
||||
Reference in New Issue
Block a user