initial changes to support wellsaid tts (#29)

This commit is contained in:
Dave Horton
2022-01-27 08:17:51 -05:00
committed by GitHub
parent 3aac11560a
commit c9bf943656
4 changed files with 78 additions and 4 deletions
+28 -1
View File
@@ -75,11 +75,38 @@ const testMicrosoftStt = async(logger, credentials) => {
return true;
};
const testWellSaidTts = async(logger, credentials) => {
const {api_key} = credentials;
try {
const post = bent('https://api.wellsaidlabs.com', 'POST', 'buffer', {
'X-Api-Key': api_key,
'Accept': 'audio/mpeg',
'Content-Type': 'application/json'
});
const mp3 = await post('/v1/tts/stream', {
text: 'Hello, world',
speaker_id: '3'
});
logger.info(`testWellSaidTts succeeded and returned ${typeof mp3}`);
return true;
} catch (err) {
logger.info({err}, 'testWellSaidTts returned error');
throw err;
}
};
const testWellSaidStt = async(logger, credentials) => {
//TODO
return true;
};
module.exports = {
testGoogleTts,
testGoogleStt,
testAwsTts,
testWellSaidTts,
testAwsStt,
testMicrosoftTts,
testMicrosoftStt
testMicrosoftStt,
testWellSaidStt,
};