mirror of
https://github.com/jambonz/speech-utils.git
synced 2026-07-24 21:22:00 +00:00
merge latest main into feature branch
This commit is contained in:
@@ -12,6 +12,32 @@ const stats = {
|
||||
histogram: () => {}
|
||||
};
|
||||
|
||||
test('Verbio - get Access key and voices', async(t) => {
|
||||
const fn = require('..');
|
||||
const {client, getTtsVoices, getVerbioAccessToken} = fn(opts, logger);
|
||||
if (!process.env.VERBIO_CLIENT_ID || !process.env.VERBIO_CLIENT_SECRET) {
|
||||
t.pass('skipping Verbio test since no Verbio Keys provided');
|
||||
t.end();
|
||||
client.quit();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const credentials = {
|
||||
client_id: process.env.VERBIO_CLIENT_ID,
|
||||
client_secret: process.env.VERBIO_CLIENT_SECRET
|
||||
};
|
||||
let obj = await getVerbioAccessToken(credentials);
|
||||
t.ok(obj.access_token , 'successfully received access token not from cache');
|
||||
const voices = await getTtsVoices({vendor: 'verbio', credentials});
|
||||
t.ok(voices && voices.length != 0, 'successfully received verbio voices');
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
t.end(err);
|
||||
}
|
||||
client.quit();
|
||||
});
|
||||
|
||||
test('IBM - create access key', async(t) => {
|
||||
const fn = require('..');
|
||||
const {client, getIbmAccessToken} = fn(opts, logger);
|
||||
|
||||
@@ -670,6 +670,40 @@ test('whisper speech synth tests', async(t) => {
|
||||
language: 'en-US',
|
||||
voice: 'alloy',
|
||||
text,
|
||||
renderForCaching: true
|
||||
});
|
||||
t.ok(!opts.servedFromCache, `successfully synthesized whisper audio to ${opts.filePath}`);
|
||||
|
||||
} catch (err) {
|
||||
console.error(JSON.stringify(err));
|
||||
t.end(err);
|
||||
}
|
||||
client.quit();
|
||||
});
|
||||
|
||||
test('Verbio speech synth tests', async(t) => {
|
||||
const fn = require('..');
|
||||
const {synthAudio, client} = fn(opts, logger);
|
||||
|
||||
if (!process.env.VERBIO_CLIENT_ID || !process.env.VERBIO_CLIENT_SECRET) {
|
||||
t.pass('skipping Verbio Synthesize test since no Verbio Keys provided');
|
||||
t.end();
|
||||
client.quit();
|
||||
return;
|
||||
}
|
||||
|
||||
const text = 'Hi there and welcome to jambones!';
|
||||
try {
|
||||
let opts = await synthAudio(stats, {
|
||||
vendor: 'verbio',
|
||||
credentials: {
|
||||
client_id: process.env.VERBIO_CLIENT_ID,
|
||||
client_secret: process.env.VERBIO_CLIENT_SECRET
|
||||
},
|
||||
language: 'en-US',
|
||||
voice: 'tommy_en-us',
|
||||
text,
|
||||
renderForCaching: true
|
||||
});
|
||||
t.ok(!opts.servedFromCache, `successfully synthesized whisper audio to ${opts.filePath}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user