allow azure stt custom speech endpoint id to be passed as property in recognizer

This commit is contained in:
Dave Horton
2022-10-05 21:57:14 +01:00
parent 8a2b2962f8
commit b2cac47d05
3 changed files with 11 additions and 2 deletions

View File

@@ -82,6 +82,7 @@ class TaskGather extends Task {
this.requestSnr = recognizer.requestSnr || false;
this.initialSpeechTimeoutMs = recognizer.initialSpeechTimeoutMs || 0;
this.azureServiceEndpoint = recognizer.azureServiceEndpoint;
this.azureSttEndpointId = recognizer.azureSttEndpointId;
}
else {
this.hints = [];
@@ -364,7 +365,10 @@ class TaskGather extends Task {
'AZURE_SUBSCRIPTION_KEY': api_key,
'AZURE_REGION': region
});
if (use_custom_stt && custom_stt_endpoint) {
if (this.azureSttEndpointId) {
Object.assign(opts, {'AZURE_SERVICE_ENDPOINT_ID': this.azureSttEndpointId});
}
else if (use_custom_stt && custom_stt_endpoint) {
Object.assign(opts, {'AZURE_SERVICE_ENDPOINT_ID': custom_stt_endpoint});
}
}