mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
allow azure stt custom speech endpoint id to be passed as property in recognizer
This commit is contained in:
@@ -82,6 +82,7 @@ class TaskGather extends Task {
|
|||||||
this.requestSnr = recognizer.requestSnr || false;
|
this.requestSnr = recognizer.requestSnr || false;
|
||||||
this.initialSpeechTimeoutMs = recognizer.initialSpeechTimeoutMs || 0;
|
this.initialSpeechTimeoutMs = recognizer.initialSpeechTimeoutMs || 0;
|
||||||
this.azureServiceEndpoint = recognizer.azureServiceEndpoint;
|
this.azureServiceEndpoint = recognizer.azureServiceEndpoint;
|
||||||
|
this.azureSttEndpointId = recognizer.azureSttEndpointId;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.hints = [];
|
this.hints = [];
|
||||||
@@ -364,7 +365,10 @@ class TaskGather extends Task {
|
|||||||
'AZURE_SUBSCRIPTION_KEY': api_key,
|
'AZURE_SUBSCRIPTION_KEY': api_key,
|
||||||
'AZURE_REGION': region
|
'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});
|
Object.assign(opts, {'AZURE_SERVICE_ENDPOINT_ID': custom_stt_endpoint});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -497,6 +497,7 @@
|
|||||||
"requestSnr": "boolean",
|
"requestSnr": "boolean",
|
||||||
"initialSpeechTimeoutMs": "number",
|
"initialSpeechTimeoutMs": "number",
|
||||||
"azureServiceEndpoint": "string",
|
"azureServiceEndpoint": "string",
|
||||||
|
"azureSttEndpointId": "string",
|
||||||
"asrDtmfTerminationDigit": "string",
|
"asrDtmfTerminationDigit": "string",
|
||||||
"asrTimeout": "number"
|
"asrTimeout": "number"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ class TaskTranscribe extends Task {
|
|||||||
this.requestSnr = recognizer.requestSnr || false;
|
this.requestSnr = recognizer.requestSnr || false;
|
||||||
this.initialSpeechTimeoutMs = recognizer.initialSpeechTimeoutMs || 0;
|
this.initialSpeechTimeoutMs = recognizer.initialSpeechTimeoutMs || 0;
|
||||||
this.azureServiceEndpoint = recognizer.azureServiceEndpoint;
|
this.azureServiceEndpoint = recognizer.azureServiceEndpoint;
|
||||||
|
this.azureSttEndpointId = recognizer.azureSttEndpointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
get name() { return TaskName.Transcribe; }
|
get name() { return TaskName.Transcribe; }
|
||||||
@@ -237,7 +238,10 @@ class TaskTranscribe extends Task {
|
|||||||
'AZURE_SUBSCRIPTION_KEY': api_key,
|
'AZURE_SUBSCRIPTION_KEY': api_key,
|
||||||
'AZURE_REGION': region
|
'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});
|
Object.assign(opts, {'AZURE_SERVICE_ENDPOINT_ID': custom_stt_endpoint});
|
||||||
}
|
}
|
||||||
if (this.hints && this.hints.length > 0) {
|
if (this.hints && this.hints.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user