mirror of
https://github.com/jambonz/speech-utils.git
synced 2026-07-04 19:31:49 +00:00
get elevenlabs options from syntheizier.options
This commit is contained in:
+5
-5
@@ -76,7 +76,7 @@ const trimTrailingSilence = (buffer) => {
|
||||
* the synthesized audio, and a variable indicating whether it was served from cache
|
||||
*/
|
||||
async function synthAudio(client, logger, stats, { account_sid,
|
||||
vendor, language, voice, gender, text, engine, salt, model, credentials, deploymentId, disableTtsCache
|
||||
vendor, language, voice, gender, text, engine, salt, model, credentials, deploymentId, disableTtsCache, options
|
||||
}) {
|
||||
let audioBuffer;
|
||||
let servedFromCache = false;
|
||||
@@ -194,7 +194,7 @@ async function synthAudio(client, logger, stats, { account_sid,
|
||||
audioBuffer = await synthWellSaid(logger, {credentials, stats, language, voice, text, filePath});
|
||||
break;
|
||||
case 'elevenlabs':
|
||||
audioBuffer = await synthElevenlabs(logger, {credentials, stats, language, voice, text, filePath});
|
||||
audioBuffer = await synthElevenlabs(logger, {credentials, options, stats, language, voice, text, filePath});
|
||||
break;
|
||||
case 'whisper':
|
||||
audioBuffer = await synthWhisper(logger, {credentials, stats, voice, text});
|
||||
@@ -585,9 +585,9 @@ const synthCustomVendor = async(logger, {credentials, stats, language, voice, te
|
||||
}
|
||||
};
|
||||
|
||||
const synthElevenlabs = async(logger, {credentials, stats, language, voice, text}) => {
|
||||
const {api_key, model_id, options} = credentials;
|
||||
const opts = JSON.parse(options || '{}');
|
||||
const synthElevenlabs = async(logger, {credentials, options, stats, language, voice, text}) => {
|
||||
const {api_key, model_id, options: credOpts} = credentials;
|
||||
const opts = JSON.parse(options || credOpts || '{}');
|
||||
const optimize_streaming_latency = opts.optimize_streaming_latency ?
|
||||
`?optimize_streaming_latency=${opts.optimize_streaming_latency}` : '';
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user