mirror of
https://github.com/jambonz/speech-utils.git
synced 2026-10-03 23:33:59 +00:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69b3fdffbe | ||
|
|
53fe72d89e | ||
|
|
e79c15c5da | ||
|
|
a4a427e174 | ||
|
|
b697bc5268 | ||
|
|
d35d7f0aec | ||
|
|
ed1c564fa2 | ||
|
|
7189d471c1 |
+23
-2
@@ -215,7 +215,8 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc
|
||||
audioData = await synthNuance(client, logger, {credentials, stats, voice, model, text});
|
||||
break;
|
||||
case 'nvidia':
|
||||
audioData = await synthNvidia(client, logger, {credentials, stats, language, voice, model, text});
|
||||
audioData = await synthNvidia(client, logger, {credentials, stats, language, voice, model, text,
|
||||
renderForCaching, disableTtsStreaming});
|
||||
break;
|
||||
case 'ibm':
|
||||
audioData = await synthIbm(logger, {credentials, stats, voice, text});
|
||||
@@ -708,8 +709,24 @@ const synthNuance = async(client, logger, {credentials, stats, voice, model, tex
|
||||
});
|
||||
};
|
||||
|
||||
const synthNvidia = async(client, logger, {credentials, stats, language, voice, model, text}) => {
|
||||
const synthNvidia = async(client, logger, {
|
||||
credentials, stats, language, voice, model, text, renderForCaching, disableTtsStreaming
|
||||
}) => {
|
||||
const {riva_server_uri} = credentials;
|
||||
if (!JAMBONES_DISABLE_TTS_STREAMING && !renderForCaching && !disableTtsStreaming) {
|
||||
let params = '';
|
||||
params += `{riva_server_uri=${riva_server_uri}`;
|
||||
params += `,voice=${voice}`;
|
||||
params += `,language=${language}`;
|
||||
params += ',write_cache_file=1';
|
||||
params += '}';
|
||||
|
||||
return {
|
||||
filePath: `say:${params}${text.replace(/\n/g, ' ')}`,
|
||||
servedFromCache: false,
|
||||
rtt: 0
|
||||
};
|
||||
}
|
||||
let rivaClient, request;
|
||||
const sampleRate = 8000;
|
||||
try {
|
||||
@@ -789,9 +806,13 @@ const synthElevenlabs = async(logger, {
|
||||
if (opts.voice_settings?.similarity_boost) params += `,similarity_boost=${opts.voice_settings.similarity_boost}`;
|
||||
if (opts.voice_settings?.stability) params += `,stability=${opts.voice_settings.stability}`;
|
||||
if (opts.voice_settings?.style) params += `,style=${opts.voice_settings.style}`;
|
||||
if (opts.voice_settings?.speed !== null && opts.voice_settings?.speed !== undefined)
|
||||
params += `,speed=${opts.voice_settings.speed}`;
|
||||
if (opts.voice_settings?.use_speaker_boost === false) params += ',use_speaker_boost=false';
|
||||
if (opts.previous_text) params += `,previous_text=${opts.previous_text}`;
|
||||
if (opts.next_text) params += `,next_text=${opts.next_text}`;
|
||||
if (opts.pronunciation_dictionary_locators && Array.isArray(opts.pronunciation_dictionary_locators))
|
||||
params += `,pronunciation_dictionary_locators=${JSON.stringify(opts.pronunciation_dictionary_locators)}`;
|
||||
params += '}';
|
||||
|
||||
return {
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@jambonz/speech-utils",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@jambonz/speech-utils",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.6",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-polly": "^3.496.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@jambonz/speech-utils",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.6",
|
||||
"description": "TTS-related speech utilities for jambonz",
|
||||
"main": "index.js",
|
||||
"author": "Dave Horton",
|
||||
|
||||
Reference in New Issue
Block a user