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
020b27bc
Commit
020b27bc
authored
Nov 17, 2017
by
Yoann HOUPERT
Browse files
init structure
parent
f3dbc9e6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
127 additions
and
3 deletions
+127
-3
app.js
app.js
+1
-1
doc/README.md
doc/README.md
+4
-0
doc/REST_API/REST_transcript.md
doc/REST_API/REST_transcript.md
+51
-0
lib/speech-enhancement.js
lib/speech-enhancement.js
+30
-0
lib/speech-to-text.js
lib/speech-to-text.js
+30
-0
lib/webserver/routes.js
lib/webserver/routes.js
+11
-2
No files found.
app.js
View file @
020b27bc
...
...
@@ -25,7 +25,7 @@ const routes = require('./lib/webserver/routes');
console
.
log
(
'
starting routes linstt-poc-socgen...
'
);
app
.
use
(
'
/
'
,
routes
.
routesFactory
());
app
.
use
(
'
/
'
,
routes
.
routesFactory
(
config
.
orchestrator
));
app
.
listen
(
config
.
api
,
()
=>
{
console
.
log
(
'
App listening on port 3000
'
);
});
...
...
doc/README.md
0 → 100644
View file @
020b27bc
linstt-poc-socgen Documentation
You will find in this folder all the required information to configure, use, develop the linstt-poc-socgen project.
doc/REST_API/REST_transcript.md
0 → 100644
View file @
020b27bc
# POST /api/transcript
Create a transcript text from an audio file
**Request Headers:**
-
Accept: application/json
**Request Body**
This endpoint expects the request body to be a wav file
-
Rate 16KHz
-
Canal 1
-
Binary 16
-
Encoding little endian
**Status Codes:**
-
200 Ok
-
500 Internal server error
**Response Headers:**
-
Content-Type: application/json
**Response JSON Object:**
-
text: contain the transcription (only on succes)
-
status: contain the state of the answser (only on error)
-
err: contain the error description (only on error)
**Request:**
POST /api/transcript
Accept: application/json
Host: localhost:8080
A wav File
**Response:**
HTTP/1.1 200 Ok
{
text : 'here the transcript'
}
HTTP/1.1 500 Ok
{
status : X , err : 'here the error'
}
lib/speech-enhancement.js
0 → 100644
View file @
020b27bc
/*
* Copyright (c) 2017 Linagora.
*
* This file is part of linstt-poc-socgen
* (see https://ci.linagora.com/linagora/lgs/labs/linstt-poc-socgen).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const
enhancement
=
audio
=>
{
console
.
log
(
'
transcript of the audio
'
);
console
.
log
(
'
Do stuff
'
+
audio
);
return
'
some text
'
;
};
module
.
exports
=
{
enhancement
};
lib/speech-to-text.js
0 → 100644
View file @
020b27bc
/*
* Copyright (c) 2017 Linagora.
*
* This file is part of linstt-poc-socgen
* (see https://ci.linagora.com/linagora/lgs/labs/linstt-poc-socgen).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const
transcript
=
audio
=>
{
const
enhancedAudio
=
audio
;
console
.
log
(
'
Enhancement of the audio
'
);
return
enhancedAudio
;
};
module
.
exports
=
{
transcript
};
lib/webserver/routes.js
View file @
020b27bc
...
...
@@ -17,12 +17,21 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const
routesFactory
=
()
=>
{
const
routesFactory
=
config
=>
{
/* eslint new-cap: ["error", { "capIsNew": false }] */
const
routes
=
require
(
'
express
'
).
Router
();
const
enhancer
=
require
(
'
../speech-enhancement
'
);
const
stt
=
require
(
'
../speech-to-text
'
);
routes
.
post
(
'
/api/transcript
'
,
(
req
,
res
)
=>
{
console
.
log
(
'
first routes
'
);
console
.
log
(
config
);
// TODO manage first call to config.speechEnhancementURL
enhancer
.
enhancement
();
// TODO manage first call to config.gstreamerURL
stt
.
transcript
();
res
.
status
(
200
).
json
({
message
:
'
transcript call
'
});
});
return
routes
;
...
...
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