Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linstt-controller
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LINAGORA
L
LGS
Labs
linstt-controller
Commits
0706f944
Commit
0706f944
authored
Dec 07, 2017
by
Yoann HOUPERT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use request body instead of file
parent
c335b71e
Pipeline
#6910
failed with stage
in 24 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
9 deletions
+4
-9
app.js
app.js
+1
-3
lib/controller/speech-enhancement.js
lib/controller/speech-enhancement.js
+1
-1
lib/webserver/routes.js
lib/webserver/routes.js
+2
-5
No files found.
app.js
View file @
0706f944
...
@@ -21,7 +21,6 @@ const https = require('https');
...
@@ -21,7 +21,6 @@ const https = require('https');
const
fs
=
require
(
'
fs
'
);
const
fs
=
require
(
'
fs
'
);
const
app
=
require
(
'
express
'
)();
const
app
=
require
(
'
express
'
)();
const
fileUpload
=
require
(
'
express-fileupload
'
);
const
bodyParser
=
require
(
'
body-parser
'
);
const
bodyParser
=
require
(
'
body-parser
'
);
const
config
=
require
(
'
./config.json
'
);
const
config
=
require
(
'
./config.json
'
);
...
@@ -29,8 +28,7 @@ const routes = require('./lib/webserver/routes');
...
@@ -29,8 +28,7 @@ const routes = require('./lib/webserver/routes');
console
.
log
(
'
starting routes linstt-controller...
'
);
console
.
log
(
'
starting routes linstt-controller...
'
);
app
.
use
(
bodyParser
.
raw
({
type
:
'
audio/wav
'
,
limit
:
'
200mb
'
}));
app
.
use
(
bodyParser
.
raw
({
type
:
'
audio/wave
'
,
limit
:
'
200mb
'
}));
app
.
use
(
fileUpload
());
app
.
use
(
'
/
'
,
routes
.
routesFactory
(
config
.
orchestrator
));
app
.
use
(
'
/
'
,
routes
.
routesFactory
(
config
.
orchestrator
));
app
.
listen
(
config
.
api
,
()
=>
{
app
.
listen
(
config
.
api
,
()
=>
{
...
...
lib/controller/speech-enhancement.js
View file @
0706f944
...
@@ -29,7 +29,7 @@ module.exports = config => {
...
@@ -29,7 +29,7 @@ module.exports = config => {
url
,
url
,
formData
:
{
formData
:
{
wavFile
:
{
wavFile
:
{
value
:
wavFile
.
data
,
value
:
wavFile
,
options
:
{
options
:
{
filename
:
'
wavFile
'
,
filename
:
'
wavFile
'
,
contentType
:
'
audio/x-wav
'
contentType
:
'
audio/x-wav
'
...
...
lib/webserver/routes.js
View file @
0706f944
...
@@ -26,14 +26,11 @@ const routesFactory = config => {
...
@@ -26,14 +26,11 @@ const routesFactory = config => {
const
checker
=
require
(
'
../util/checker
'
);
const
checker
=
require
(
'
../util/checker
'
);
routes
.
post
(
'
/api/transcript
'
,
(
req
,
res
)
=>
{
routes
.
post
(
'
/api/transcript
'
,
(
req
,
res
)
=>
{
if
(
!
req
.
files
)
{
if
(
!
req
.
body
)
{
return
res
.
status
(
400
).
send
(
'
No files were uploaded.
'
);
return
res
.
status
(
400
).
send
(
'
No files were uploaded.
'
);
}
}
if
(
!
checker
.
isFileValid
(
req
.
files
.
wav
))
{
return
res
.
status
(
400
).
send
(
'
File is not valid.
'
);
}
enhancer
.
enhancement
(
req
.
files
.
wav
,
(
err
,
httpResponse
,
body
)
=>
{
enhancer
.
enhancement
(
req
.
body
,
(
err
,
httpResponse
,
body
)
=>
{
if
(
err
)
{
if
(
err
)
{
return
res
.
status
(
500
).
send
(
'
Error while enhancing audio.
'
+
err
);
return
res
.
status
(
500
).
send
(
'
Error while enhancing audio.
'
+
err
);
}
}
...
...
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