@jambonz/speech-utils 0.1.6 → 0.1.9
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/config.js +2 -0
- package/lib/synth-audio.js +5 -1
- package/package.json +1 -1
package/lib/config.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const JAMBONES_TTS_TRIM_SILENCE = process.env.JAMBONES_TTS_TRIM_SILENCE;
|
|
2
2
|
const JAMBONES_DISABLE_TTS_STREAMING = process.env.JAMBONES_DISABLE_TTS_STREAMING;
|
|
3
|
+
const JAMBONES_DISABLE_AZURE_TTS_STREAMING = process.env.JAMBONES_DISABLE_AZURE_TTS_STREAMING;
|
|
3
4
|
|
|
4
5
|
const JAMBONES_HTTP_PROXY_IP = process.env.JAMBONES_HTTP_PROXY_IP;
|
|
5
6
|
const JAMBONES_HTTP_PROXY_PORT = process.env.JAMBONES_HTTP_PROXY_PORT;
|
|
@@ -13,6 +14,7 @@ const HTTP_TIMEOUT = 5000;
|
|
|
13
14
|
module.exports = {
|
|
14
15
|
JAMBONES_TTS_TRIM_SILENCE,
|
|
15
16
|
JAMBONES_DISABLE_TTS_STREAMING,
|
|
17
|
+
JAMBONES_DISABLE_AZURE_TTS_STREAMING,
|
|
16
18
|
JAMBONES_HTTP_PROXY_IP,
|
|
17
19
|
JAMBONES_HTTP_PROXY_PORT,
|
|
18
20
|
JAMBONES_TTS_CACHE_DURATION_MINS,
|
package/lib/synth-audio.js
CHANGED
|
@@ -40,6 +40,7 @@ const {AudioEncoding} = require('../stubs/riva/proto/riva_audio_pb');
|
|
|
40
40
|
const debug = require('debug')('jambonz:realtimedb-helpers');
|
|
41
41
|
const {
|
|
42
42
|
JAMBONES_DISABLE_TTS_STREAMING,
|
|
43
|
+
JAMBONES_DISABLE_AZURE_TTS_STREAMING,
|
|
43
44
|
JAMBONES_HTTP_PROXY_IP,
|
|
44
45
|
JAMBONES_HTTP_PROXY_PORT,
|
|
45
46
|
JAMBONES_TTS_CACHE_DURATION_MINS,
|
|
@@ -443,7 +444,8 @@ const synthMicrosoft = async(logger, {
|
|
|
443
444
|
content = `<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="${language}"><voice name="${voice}">${words}</voice></speak>`;
|
|
444
445
|
logger.info({content}, 'synthMicrosoft');
|
|
445
446
|
}
|
|
446
|
-
if (!JAMBONES_DISABLE_TTS_STREAMING && !
|
|
447
|
+
if (!JAMBONES_DISABLE_TTS_STREAMING && !JAMBONES_DISABLE_AZURE_TTS_STREAMING &&
|
|
448
|
+
!renderForCaching && !disableTtsStreaming) {
|
|
447
449
|
let params = '';
|
|
448
450
|
params += `{api_key=${apiKey}`;
|
|
449
451
|
params += `,language=${language}`;
|
|
@@ -684,6 +686,8 @@ const synthElevenlabs = async(logger, {
|
|
|
684
686
|
if (opts.voice_settings?.stability) params += `,stability=${opts.voice_settings.stability}`;
|
|
685
687
|
if (opts.voice_settings?.style) params += `,style=${opts.voice_settings.style}`;
|
|
686
688
|
if (opts.voice_settings?.use_speaker_boost === false) params += ',use_speaker_boost=false';
|
|
689
|
+
if (opts.previous_text) params += `,previous_text=${opts.previous_text}`;
|
|
690
|
+
if (opts.next_text) params += `,next_text=${opts.next_text}`;
|
|
687
691
|
params += '}';
|
|
688
692
|
|
|
689
693
|
return {
|