From f6cead6e92a3d29c8e339aa413ab580c9cdb05ee Mon Sep 17 00:00:00 2001 From: Quan HL Date: Thu, 3 Oct 2024 19:24:23 +0700 Subject: [PATCH] add top_p and repetition_penalty to playht3.0 --- lib/synth-audio.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/synth-audio.js b/lib/synth-audio.js index f20a982..52ad754 100644 --- a/lib/synth-audio.js +++ b/lib/synth-audio.js @@ -764,8 +764,7 @@ const synthPlayHT = async(client, logger, { let synthesizeUrl = 'https://api.play.ht/api/v2/tts/stream'; - // If model is play3.0, the stream url is provided by v3 auth endpoint which is - // including jwt token as request params. + // If model is play3.0, the synthesizeUrl is got from authentication endpoint if (voice_engine === 'Play3.0') { try { const post = bent('https://api.play.ht', 'POST', 'json', 201, { @@ -806,6 +805,8 @@ const synthPlayHT = async(client, logger, { if (opts.voice_guidance) params += `,voice_guidance=${opts.voice_guidance}`; if (opts.style_guidance) params += `,style_guidance=${opts.style_guidance}`; if (opts.text_guidance) params += `,text_guidance=${opts.text_guidance}`; + if (opts.top_p) params += `,top_p=${opts.top_p}`; + if (opts.repetition_penalty) params += `,repetition_penalty=${opts.repetition_penalty}`; params += '}'; return {