support playht3.0

This commit is contained in:
Quan HL
2024-09-27 12:25:47 +07:00
parent 1a04fd736c
commit 6794a0b3be

View File

@@ -816,14 +816,16 @@ const synthPlayHT = async(client, logger, {
}
try {
const post = bent('https://api.play.ht', 'POST', 'buffer', {
'AUTHORIZATION': api_key,
'X-USER-ID': user_id,
const post = bent('POST', 'buffer', {
...(voice_engine !== 'Play3.0' && {
'AUTHORIZATION': api_key,
'X-USER-ID': user_id,
}),
'Accept': 'audio/mpeg',
'Content-Type': 'application/json'
});
const mp3 = await post('/api/v2/tts/stream', {
const mp3 = await post(synthesizeUrl, {
text,
voice,
voice_engine,