@jambonz/speech-utils 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/synth-audio.js +19 -2
- package/package.json +1 -1
package/lib/synth-audio.js
CHANGED
|
@@ -215,7 +215,8 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc
|
|
|
215
215
|
audioData = await synthNuance(client, logger, {credentials, stats, voice, model, text});
|
|
216
216
|
break;
|
|
217
217
|
case 'nvidia':
|
|
218
|
-
audioData = await synthNvidia(client, logger, {credentials, stats, language, voice, model, text
|
|
218
|
+
audioData = await synthNvidia(client, logger, {credentials, stats, language, voice, model, text,
|
|
219
|
+
renderForCaching, disableTtsStreaming});
|
|
219
220
|
break;
|
|
220
221
|
case 'ibm':
|
|
221
222
|
audioData = await synthIbm(logger, {credentials, stats, voice, text});
|
|
@@ -708,8 +709,24 @@ const synthNuance = async(client, logger, {credentials, stats, voice, model, tex
|
|
|
708
709
|
});
|
|
709
710
|
};
|
|
710
711
|
|
|
711
|
-
const synthNvidia = async(client, logger, {
|
|
712
|
+
const synthNvidia = async(client, logger, {
|
|
713
|
+
credentials, stats, language, voice, model, text, renderForCaching, disableTtsStreaming
|
|
714
|
+
}) => {
|
|
712
715
|
const {riva_server_uri} = credentials;
|
|
716
|
+
if (!JAMBONES_DISABLE_TTS_STREAMING && !renderForCaching && !disableTtsStreaming) {
|
|
717
|
+
let params = '';
|
|
718
|
+
params += `{riva_server_uri=${riva_server_uri}`;
|
|
719
|
+
params += `,voice=${voice}`;
|
|
720
|
+
params += `,language=${language}`;
|
|
721
|
+
params += ',write_cache_file=1';
|
|
722
|
+
params += '}';
|
|
723
|
+
|
|
724
|
+
return {
|
|
725
|
+
filePath: `say:${params}${text.replace(/\n/g, ' ')}`,
|
|
726
|
+
servedFromCache: false,
|
|
727
|
+
rtt: 0
|
|
728
|
+
};
|
|
729
|
+
}
|
|
713
730
|
let rivaClient, request;
|
|
714
731
|
const sampleRate = 8000;
|
|
715
732
|
try {
|