@jambonz/speech-utils 0.2.6 → 0.2.8

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.
Files changed (2) hide show
  1. package/lib/synth-audio.js +24 -2
  2. package/package.json +1 -1
@@ -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, {credentials, stats, language, voice, model, text}) => {
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 {
@@ -946,6 +963,11 @@ const synthRimelabs = async(logger, {
946
963
  params += ',write_cache_file=1';
947
964
  if (opts.speedAlpha) params += `,speed_alpha=${opts.speedAlpha}`;
948
965
  if (opts.reduceLatency) params += `,reduce_latency=${opts.reduceLatency}`;
966
+ // Arcana model parameters
967
+ if (opts.temperature) params += `,temperature=${opts.temperature}`;
968
+ if (opts.repetition_penalty) params += `,repetition_penalty=${opts.repetition_penalty}`;
969
+ if (opts.top_p) params += `,top_p=${opts.top_p}`;
970
+ if (opts.max_tokens) params += `,max_tokens=${opts.max_tokens}`;
949
971
  params += '}';
950
972
 
951
973
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jambonz/speech-utils",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "TTS-related speech utilities for jambonz",
5
5
  "main": "index.js",
6
6
  "author": "Dave Horton",