fix deepgram and playht has white noise from begining of cache audio

This commit is contained in:
Quan HL
2024-10-21 14:44:16 +07:00
parent f183852961
commit 3f5a520229

View File

@@ -35,6 +35,7 @@ function makeFilePath({vendor, key, salt = '', renderForCaching = false}) {
function getFileExtension({vendor, renderForCaching = false}) {
const mp3Extension = 'mp3';
const wavExtension = 'wav';
const r8Extension = 'r8';
switch (vendor) {
@@ -45,15 +46,20 @@ function getFileExtension({vendor, renderForCaching = false}) {
} else {
return mp3Extension;
}
case 'deepgram':
case 'elevenlabs':
case 'rimelabs':
case 'playht':
if (renderForCaching || JAMBONES_DISABLE_TTS_STREAMING) {
return mp3Extension;
} else {
return r8Extension;
}
case 'playht':
case 'deepgram':
if (renderForCaching || JAMBONES_DISABLE_TTS_STREAMING) {
return mp3Extension;
} else {
return wavExtension;
}
case 'nuance':
case 'nvidia':
case 'verbio':