mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 00:58:34 +00:00
cognigy: when use azuyre tts, request detailed output format
This commit is contained in:
@@ -126,7 +126,8 @@ class Cognigy extends Task {
|
|||||||
const opts = {
|
const opts = {
|
||||||
recognizer: this.data.recognizer || {
|
recognizer: this.data.recognizer || {
|
||||||
vendor: 'default',
|
vendor: 'default',
|
||||||
language: 'default'
|
language: 'default',
|
||||||
|
outputFormat: 'detailed'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.logger.debug({opts}, 'constructing a nested transcribe object');
|
this.logger.debug({opts}, 'constructing a nested transcribe object');
|
||||||
|
|||||||
@@ -216,12 +216,18 @@ class TaskTranscribe extends Task {
|
|||||||
if ('aws' === this.vendor && Array.isArray(evt) && evt.length > 0) evt = evt[0];
|
if ('aws' === this.vendor && Array.isArray(evt) && evt.length > 0) evt = evt[0];
|
||||||
if ('microsoft' === this.vendor) {
|
if ('microsoft' === this.vendor) {
|
||||||
const nbest = evt.NBest;
|
const nbest = evt.NBest;
|
||||||
const alternatives = nbest.map((n) => {
|
const alternatives = nbest ? nbest.map((n) => {
|
||||||
return {
|
return {
|
||||||
confidence: n.Confidence,
|
confidence: n.Confidence,
|
||||||
transcript: n.Display
|
transcript: n.Display
|
||||||
};
|
};
|
||||||
});
|
}) :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
transcript: evt.DisplayText
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
const newEvent = {
|
const newEvent = {
|
||||||
is_final: evt.RecognitionStatus === 'Success',
|
is_final: evt.RecognitionStatus === 'Success',
|
||||||
alternatives
|
alternatives
|
||||||
|
|||||||
Reference in New Issue
Block a user