@jambonz/speech-utils 0.2.2 → 0.2.4

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.
@@ -926,7 +926,7 @@ const synthPlayHT = async(client, logger, {
926
926
  };
927
927
 
928
928
  const synthRimelabs = async(logger, {
929
- credentials, options, stats, voice, text, renderForCaching, disableTtsStreaming
929
+ credentials, options, stats, language, voice, text, renderForCaching, disableTtsStreaming
930
930
  }) => {
931
931
  const {api_key, model_id, options: credOpts} = credentials;
932
932
  const opts = !!options && Object.keys(options).length !== 0 ? options : JSON.parse(credOpts || '{}');
@@ -937,6 +937,7 @@ const synthRimelabs = async(logger, {
937
937
  params += `{api_key=${api_key}`;
938
938
  params += `,model_id=${model_id}`;
939
939
  params += ',vendor=rimelabs';
940
+ params += `,language=${language}`;
940
941
  params += `,voice=${voice}`;
941
942
  params += ',write_cache_file=1';
942
943
  if (opts.speedAlpha) params += `,speed_alpha=${opts.speedAlpha}`;
@@ -962,6 +963,7 @@ const synthRimelabs = async(logger, {
962
963
  text,
963
964
  modelId: model_id,
964
965
  samplingRate: sampleRate,
966
+ lang: language,
965
967
  ...opts
966
968
  });
967
969
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jambonz/speech-utils",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "TTS-related speech utilities for jambonz",
5
5
  "main": "index.js",
6
6
  "author": "Dave Horton",
@@ -39,7 +39,7 @@
39
39
  "ibm-watson": "^8.0.0",
40
40
  "microsoft-cognitiveservices-speech-sdk": "1.38.0",
41
41
  "openai": "^4.25.0",
42
- "undici": "^6.4.0"
42
+ "undici": "^7.5.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "config": "^3.3.11",
package/test/synth.js CHANGED
@@ -720,7 +720,7 @@ test('Cartesia speech synth tests', async(t) => {
720
720
  client.quit();
721
721
  });
722
722
 
723
- test('rimelabs speech synth tests', async(t) => {
723
+ test('rimelabs speech synth tests mist', async(t) => {
724
724
  const fn = require('..');
725
725
  const {synthAudio, client} = fn(opts, logger);
726
726
 
@@ -730,7 +730,7 @@ test('rimelabs speech synth tests', async(t) => {
730
730
  }
731
731
  const text = 'Hi there and welcome to jambones!';
732
732
  try {
733
- let opts = await synthAudio(stats, {
733
+ const opts = await synthAudio(stats, {
734
734
  vendor: 'rimelabs',
735
735
  credentials: {
736
736
  api_key: process.env.RIMELABS_API_KEY,
@@ -740,7 +740,7 @@ test('rimelabs speech synth tests', async(t) => {
740
740
  reduceLatency: false
741
741
  })
742
742
  },
743
- language: 'en-US',
743
+ language: 'eng',
744
744
  voice: 'amber',
745
745
  text,
746
746
  renderForCaching: true
@@ -754,6 +754,40 @@ test('rimelabs speech synth tests', async(t) => {
754
754
  client.quit();
755
755
  });
756
756
 
757
+ test('rimelabs speech synth tests mistv2', async(t) => {
758
+ const fn = require('..');
759
+ const {synthAudio, client} = fn(opts, logger);
760
+
761
+ if (!process.env.RIMELABS_API_KEY) {
762
+ t.pass('skipping rimelabs speech synth tests since RIMELABS_API_KEY is not provided');
763
+ return t.end();
764
+ }
765
+ const text = 'Hi there and welcome to jambones!';
766
+ try {
767
+ const opts = await synthAudio(stats, {
768
+ vendor: 'rimelabs',
769
+ credentials: {
770
+ api_key: process.env.RIMELABS_API_KEY,
771
+ model_id: 'mistv2',
772
+ options: JSON.stringify({
773
+ speedAlpha: 1.0,
774
+ reduceLatency: false
775
+ })
776
+ },
777
+ language: 'spa',
778
+ voice: 'pablo',
779
+ text,
780
+ renderForCaching: true
781
+ });
782
+ t.ok(!opts.servedFromCache, `successfully synthesized rimelabs mistv2 audio to ${opts.filePath}`);
783
+
784
+ } catch (err) {
785
+ console.error(JSON.stringify(err));
786
+ t.end(err);
787
+ }
788
+ client.quit();
789
+ });
790
+
757
791
  test('whisper speech synth tests', async(t) => {
758
792
  const fn = require('..');
759
793
  const {synthAudio, client} = fn(opts, logger);