check playht can fetch voices when adding new speech credential

This commit is contained in:
Quan HL
2024-04-10 05:42:40 +07:00
parent b21d10eb3e
commit c131209d42
+8
View File
@@ -256,6 +256,14 @@ const testPlayHT = async(logger, synthAudio, credentials) => {
text: 'Hi there and welcome to jambones!'
}
);
// Test if playHT can fetch voices
const get = bent('https://api.play.ht', 'GET', 'json', {
'AUTHORIZATION' : credentials.api_key,
'X-USER-ID': credentials.user_id,
'Accept': 'application/json'
});
await Promise.all([ get('/api/v2/cloned-voices'), get('/api/v2/voices')]);
} catch (err) {
logger.info({err}, 'synth Playht returned error');
throw err;