mirror of
https://github.com/jambonz/speech-utils.git
synced 2026-07-24 05:01:51 +00:00
fix private azure link with credential
This commit is contained in:
+3
-2
@@ -380,7 +380,7 @@ async function _synthOnPremMicrosoft(logger, {
|
||||
text,
|
||||
filePath
|
||||
}) {
|
||||
const {use_custom_tts, custom_tts_endpoint_url} = credentials;
|
||||
const {use_custom_tts, custom_tts_endpoint_url, api_key} = credentials;
|
||||
let content = text;
|
||||
|
||||
if (use_custom_tts && !content.startsWith('<speak')) {
|
||||
@@ -404,7 +404,8 @@ async function _synthOnPremMicrosoft(logger, {
|
||||
const post = bent('POST', 'buffer', {
|
||||
'X-Microsoft-OutputFormat': trimSilence ? 'raw-8khz-16bit-mono-pcm' : 'audio-16khz-32kbitrate-mono-mp3',
|
||||
'Content-Type': 'application/ssml+xml',
|
||||
'User-Agent': 'Jambonz'
|
||||
'User-Agent': 'Jambonz',
|
||||
...(api_key && {'Ocp-Apim-Subscription-Key': api_key})
|
||||
});
|
||||
const mp3 = await post(custom_tts_endpoint_url, content);
|
||||
return mp3;
|
||||
|
||||
Reference in New Issue
Block a user