mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-07-24 13:02:16 +00:00
feat: add nuance on-premise (#131)
* feat: add nuance on-premise * feat: update fetch nuance credential * fix: update * fix nuance tts test against on-prem, refactor aws/google tts testing to use speech-utils package --------- Co-authored-by: Quan HL <quanluuhoang8@gmail.com> Co-authored-by: Dave Horton <daveh@beachdognet.com>
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
const ttsGoogle = require('@google-cloud/text-to-speech');
|
||||
const sttGoogle = require('@google-cloud/speech').v1p1beta1;
|
||||
const { PollyClient, DescribeVoicesCommand } = require('@aws-sdk/client-polly');
|
||||
const { TranscribeClient, ListVocabulariesCommand } = require('@aws-sdk/client-transcribe');
|
||||
const { Deepgram } = require('@deepgram/sdk');
|
||||
const sdk = require('microsoft-cognitiveservices-speech-sdk');
|
||||
@@ -34,9 +32,10 @@ const testNuanceStt = async(logger, credentials) => {
|
||||
return true;
|
||||
};
|
||||
|
||||
const testGoogleTts = async(logger, credentials) => {
|
||||
const client = new ttsGoogle.TextToSpeechClient({credentials});
|
||||
await client.listVoices();
|
||||
const testGoogleTts = async(logger, getTtsVoices, credentials) => {
|
||||
const voices = await getTtsVoices({vendor: 'google', credentials});
|
||||
return voices;
|
||||
|
||||
};
|
||||
|
||||
const testGoogleStt = async(logger, credentials) => {
|
||||
@@ -120,19 +119,10 @@ const testMicrosoftStt = async(logger, credentials) => {
|
||||
});
|
||||
};
|
||||
|
||||
const testAwsTts = async(logger, credentials) => {
|
||||
const testAwsTts = async(logger, getTtsVoices, credentials) => {
|
||||
try {
|
||||
const {region, accessKeyId, secretAccessKey} = credentials;
|
||||
const client = new PollyClient({
|
||||
region,
|
||||
credentials: {
|
||||
accessKeyId,
|
||||
secretAccessKey
|
||||
}
|
||||
});
|
||||
const command = new DescribeVoicesCommand({LanguageCode: 'en-US'});
|
||||
const response = await client.send(command);
|
||||
return response;
|
||||
const voices = await getTtsVoices({vendor: 'aws', credentials});
|
||||
return voices;
|
||||
} catch (err) {
|
||||
logger.info({err}, 'testMicrosoftTts - failed to list voices for region ${region}');
|
||||
throw err;
|
||||
|
||||
Reference in New Issue
Block a user