diff --git a/lib/utils/speech-utils.js b/lib/utils/speech-utils.js index d6c5121..325aa15 100644 --- a/lib/utils/speech-utils.js +++ b/lib/utils/speech-utils.js @@ -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;