fixed houndify speech credential validation skiped if custom endpoint provided

This commit is contained in:
Hoan HL
2025-12-04 07:58:52 +07:00
committed by Dave Horton
parent 1aa28e8ba0
commit fd9e6db928

View File

@@ -659,9 +659,16 @@ const testAssemblyStt = async(logger, credentials) => {
};
const testHoundifyStt = async(logger, credentials) => {
const {client_id, client_key, user_id} = credentials;
const {client_id, client_key, user_id, houndify_server_uri} = credentials;
return new Promise((resolve, reject) => {
// api-server use houndify js sdk, which connect to wss server
// freeswitch modules use houndify c/c++ sdk, which connect to https server
// we cannot test credentials on https server here.
if (houndify_server_uri) {
return true;
}
try {
// Read the test audio file
const audioBuffer = fs.readFileSync(`${__dirname}/../../data/test_audio.wav`);
@@ -678,8 +685,6 @@ const testHoundifyStt = async(logger, credentials) => {
Latitude: 37.388309,
Longitude: -121.973968,
},
// custom endpint is used only for feature server.
// ...(houndify_server_uri && {endpoint: houndify_server_uri}),
// Audio format configuration
sampleRate: 16000,