This commit is contained in:
Quan HL
2023-11-09 12:59:20 +07:00
parent 750ed97312
commit ea523a7a1d
2 changed files with 4 additions and 4 deletions

View File

@@ -124,7 +124,7 @@ async function synthAudio(client, logger, stats, { account_sid,
assert.ok(credentials.model_id, 'synthAudio requires model_id when elevenlabs is used');
} else if ('whisper' === vendor) {
assert.ok(voice, 'synthAudio requires voice when whisper is used');
assert.ok(credentials.model, 'synthAudio requires model when whisper is used');
assert.ok(credentials.model_id, 'synthAudio requires model when whisper is used');
assert.ok(credentials.api_key, 'synthAudio requires api_key when whisper is used');
} else if (vendor.startsWith('custom')) {
assert.ok(credentials.custom_tts_url, `synthAudio requires custom_tts_url in credentials when ${vendor} is used`);
@@ -610,7 +610,7 @@ const synthElevenlabs = async(logger, {credentials, stats, language, voice, text
};
const synthWhisper = async(logger, {credentials, stats, voice, text}) => {
const {api_key, model, baseURL, timeout} = credentials;
const {api_key, model_id, baseURL, timeout} = credentials;
try {
const openai = new OpenAI.OpenAI({
apiKey: api_key,
@@ -619,7 +619,7 @@ const synthWhisper = async(logger, {credentials, stats, voice, text}) => {
});
const mp3 = await openai.audio.speech.create({
model,
model: model_id,
voice,
input: text,
response_format: 'mp3'

View File

@@ -488,7 +488,7 @@ test('whisper speech synth tests', async(t) => {
vendor: 'whisper',
credentials: {
api_key: process.env.OPENAI_API_KEY,
model: 'tts-1'
model_id: 'tts-1'
},
language: 'en-US',
voice: 'alloy',