Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
LINAGORA
L
LGS
Labs
linstt-controller
Commits
5d5ea325
Commit
5d5ea325
authored
Jan 12, 2018
by
Yoann HOUPERT
Browse files
syncronisation respons offline online
parent
4142f7a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
lib/webserver/routes.js
lib/webserver/routes.js
+13
-1
No files found.
lib/webserver/routes.js
View file @
5d5ea325
...
...
@@ -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
);
...
...
@@ -40,8 +41,19 @@ const routesFactory = config => {
const
json
=
JSON
.
parse
(
body
);
if
(
json
.
status
===
5
)
{
return
res
.
status
(
500
).
send
(
'
Error while transcript the audio.
'
);
}
else
if
(
err
)
{
return
res
.
status
(
500
).
send
(
'
Error while transcript the audio :
'
+
err
);
}
return
res
.
status
(
200
).
json
({
message
:
'
transcript done
'
,
hypotheses
:
json
});
const
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
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment