mirror of
https://github.com/jambonz/speech-utils.git
synced 2026-01-25 02:08:26 +00:00
fix deepgram and playht has white noise from begining of cache audio
This commit is contained in:
10
lib/utils.js
10
lib/utils.js
@@ -35,6 +35,7 @@ function makeFilePath({vendor, key, salt = '', renderForCaching = false}) {
|
|||||||
|
|
||||||
function getFileExtension({vendor, renderForCaching = false}) {
|
function getFileExtension({vendor, renderForCaching = false}) {
|
||||||
const mp3Extension = 'mp3';
|
const mp3Extension = 'mp3';
|
||||||
|
const wavExtension = 'wav';
|
||||||
const r8Extension = 'r8';
|
const r8Extension = 'r8';
|
||||||
|
|
||||||
switch (vendor) {
|
switch (vendor) {
|
||||||
@@ -45,15 +46,20 @@ function getFileExtension({vendor, renderForCaching = false}) {
|
|||||||
} else {
|
} else {
|
||||||
return mp3Extension;
|
return mp3Extension;
|
||||||
}
|
}
|
||||||
case 'deepgram':
|
|
||||||
case 'elevenlabs':
|
case 'elevenlabs':
|
||||||
case 'rimelabs':
|
case 'rimelabs':
|
||||||
case 'playht':
|
|
||||||
if (renderForCaching || JAMBONES_DISABLE_TTS_STREAMING) {
|
if (renderForCaching || JAMBONES_DISABLE_TTS_STREAMING) {
|
||||||
return mp3Extension;
|
return mp3Extension;
|
||||||
} else {
|
} else {
|
||||||
return r8Extension;
|
return r8Extension;
|
||||||
}
|
}
|
||||||
|
case 'playht':
|
||||||
|
case 'deepgram':
|
||||||
|
if (renderForCaching || JAMBONES_DISABLE_TTS_STREAMING) {
|
||||||
|
return mp3Extension;
|
||||||
|
} else {
|
||||||
|
return wavExtension;
|
||||||
|
}
|
||||||
case 'nuance':
|
case 'nuance':
|
||||||
case 'nvidia':
|
case 'nvidia':
|
||||||
case 'verbio':
|
case 'verbio':
|
||||||
|
|||||||
Reference in New Issue
Block a user