mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-07-24 04:52:03 +00:00
initial changes to support wellsaid tts (#29)
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user