Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
xquanluu committed Jan 9, 2025
1 parent bfc5f3c commit bbb9885
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
4 changes: 0 additions & 4 deletions lib/session/call-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -1110,10 +1110,6 @@ class CallSession extends Emitter {
auth_token: credential.auth_token,
custom_stt_url: credential.custom_stt_url,
custom_tts_url: credential.custom_tts_url,
use_audio_resampling: credential.use_audio_resampling,
use_base64_encoding: credential.use_base64_encoding,
tts_streaming_sample_rate: credential.tts_streaming_sample_rate,
use_tls: credential.use_tls
};
}
}
Expand Down
11 changes: 4 additions & 7 deletions lib/tasks/tts-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ class TtsTask extends Task {
}

async setTtsStreamingChannelVars(vendor, language, voice, credentials, ep) {
const {api_key, model_id, custom_tts_url, auth_token, use_audio_resampling,
use_base64_encoding, tts_streaming_sample_rate, use_tls} = credentials;
const {api_key, model_id, custom_tts_url, auth_token} = credentials;
const {stability, similarity_boost, use_speaker_boost, style} = this.options;
let obj;

Expand Down Expand Up @@ -97,15 +96,13 @@ class TtsTask extends Task {
break;
default:
if (vendor.startsWith('custom:')) {
const use_tls = custom_tts_url.startsWith('wss://');
obj = {
CUSTOM_TTS_STREAMING_HOST: custom_tts_url,
CUSTOM_TTS_STREAMING_HOST: custom_tts_url.replace(/^(ws|wss):\/\//, ''),
CUSTOM_TTS_STREAMING_API_KEY: auth_token,
CUSTOM_TTS_STREAMING_VOICE_ID: voice,
CUSTOM_TTS_STREAMING_LANGUAGE: language || 'en',
CUSTOM_TTS_STREAMING_USE_AUDIO_RESAMPLING: use_audio_resampling || false,
CUSTOM_TTS_STREAMING_USE_BASE64_ENCODING: use_base64_encoding || false,
CUSTOM_TTS_STREAMING_AUDIO_SAMPLE_RATE: tts_streaming_sample_rate || 8000,
CUSTOM_TTS_STREAMING_USE_TLS: use_tls || false,
CUSTOM_TTS_STREAMING_USE_TLS: use_tls
};
} else {
throw new Error(`vendor ${vendor} is not supported for tts streaming yet`);
Expand Down
4 changes: 0 additions & 4 deletions lib/utils/db-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ const speechMapper = (cred) => {
obj.auth_token = o.auth_token;
obj.custom_stt_url = o.custom_stt_url;
obj.custom_tts_url = o.custom_tts_url;
obj.use_audio_resampling = o.use_audio_resampling;
obj.use_base64_encoding = o.use_base64_encoding;
obj.tts_streaming_sample_rate = o.tts_streaming_sample_rate;
obj.use_tls = o.use_tls;
}
} catch (err) {
console.log(err);
Expand Down

0 comments on commit bbb9885

Please sign in to comment.