Commit f3838b7b authored by Yoann HOUPERT's avatar Yoann HOUPERT

syncronisation respons offline online

parent 4142f7a5
Pipeline #9690 failed with stage
in 2 minutes and 9 seconds
......@@ -21,6 +21,7 @@
const routesFactory = config => {
/* eslint new-cap: ["error", { "capIsNew": false }] */
const routes = require('express').Router();
const uuidv1 = require('uuid/v1');
const enhancer = require('../controller/speech-enhancement')(config.speechEnhancement);
const stt = require('../controller/speech-to-text')(config.gstreamer);
const offline = require('../controller/offline')(config.offline);
......@@ -41,7 +42,16 @@ const routesFactory = config => {
if (json.status === 5) {
return res.status(500).send('Error while transcript the audio.');
}
return res.status(200).json({message: 'transcript done', hypotheses: json});
let jsonResponse = {
status : 0,
hypotheses : [{
utterance : json.transcript
}],
id : uuidv1()
};
return res.status(200).json({message: 'transcript done', transcript: jsonResponse});
});
} else {
stt.transcript(body, (err, httpResponse, body) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment