mirror of
https://github.com/jambonz/speech-utils.git
synced 2025-12-19 03:37:49 +00:00
wip
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user