Commit eee97a35 authored by Yoann HOUPERT's avatar Yoann HOUPERT

add persistance resume

parent 8bdc8b34
MODELS_PATH=../models/current_model/hublot_model/ MODELS_PATH=/home/yhoupert/1To/Models/MODEL_BIG/current_model/hublot_model/
MODEL_PATH_OFFLINE=../models/current_model/ MODEL_PATH_OFFLINE=/home/yhoupert/1To/Models/MODEL_BIG/current_model/
RESUME_PATH=/home/yhoupert/1To/Hublot/Developpement/hublot/resume
OFFLINE_PORT=8888 OFFLINE_PORT=8888
YAML=/opt/models/gmm_hmm3.yaml YAML=/opt/models/gmm_hmm3.yaml
NB_WORKERS=2 NB_WORKERS=1
ASD_SERVER_IP="localhost" DEBUG="lib:*"
ASD_CONTROL_PORT=8881
ASD_STREAM_PORT=8882
DEBUG="lib:*"
\ No newline at end of file
...@@ -103,8 +103,7 @@ robot = { ...@@ -103,8 +103,7 @@ robot = {
}, },
recordParticipant(easyrtcid) { recordParticipant(easyrtcid) {
robot.socket.emit('new_user', {userId: easyrtcid, roomId: robot.room});
robot.socket.emit('new_user', {userId : easyrtcid, roomId : robot.room});
robot.getUserStream(easyrtcid); robot.getUserStream(easyrtcid);
robot.recordedParticipantsWS.push(easyrtcid); robot.recordedParticipantsWS.push(easyrtcid);
}, },
...@@ -158,7 +157,7 @@ robot = { ...@@ -158,7 +157,7 @@ robot = {
console.log(e); console.log(e);
}); });
robot.socket.on('resume_data_'+room, hyp => { robot.socket.on('resume_data_' + room, hyp => {
if (hyp.status === 0) { if (hyp.status === 0) {
if (hyp.result !== undefined && hyp.result.final) { if (hyp.result !== undefined && hyp.result.final) {
const transcription = ((hyp.result.hypotheses)[0]).transcript; const transcription = ((hyp.result.hypotheses)[0]).transcript;
......
...@@ -11,8 +11,12 @@ services: ...@@ -11,8 +11,12 @@ services:
- offline-server - offline-server
volumes: volumes:
- ./media:/opt/media - ./media:/opt/media
- ${RESUME_PATH}:/usr/src/app/hublot/resume
ports: ports:
- "3000:3000" - "3000:3000"
env_file: .env
environment:
- RESUME_PATH
recommender: recommender:
image: linagora/recommender image: linagora/recommender
......
...@@ -55,7 +55,7 @@ class Asd extends EventEmitter { ...@@ -55,7 +55,7 @@ class Asd extends EventEmitter {
this.init(); this.init();
}, 2000); }, 2000);
} }
try { try {
const controlTcpClient = new net.Socket(); const controlTcpClient = new net.Socket();
controlTcpClient.once('error', err => { controlTcpClient.once('error', err => {
......
...@@ -95,7 +95,6 @@ module.exports = config => { ...@@ -95,7 +95,6 @@ module.exports = config => {
connectionToClient.send(xmlHttp.responseText); connectionToClient.send(xmlHttp.responseText);
} catch (err) { } catch (err) {
console.error('proxy: recoRecoWS error', err); console.error('proxy: recoRecoWS error', err);
console.error('It is probably already close');
} }
} else { } else {
console.error('Online reco: error trying to reach http://%s:%s/resources', console.error('Online reco: error trying to reach http://%s:%s/resources',
...@@ -121,13 +120,12 @@ module.exports = config => { ...@@ -121,13 +120,12 @@ module.exports = config => {
connectionToKaldi.on('open', () => { connectionToKaldi.on('open', () => {
connectionToKaldi.on('message', message => { connectionToKaldi.on('message', message => {
try { try {
const msgJson = JSON.parse(message); const msgJson = JSON.parse(message);
msgJson.userId = userId; msgJson.userId = userId;
msgJson.roomId = roomId; msgJson.roomId = roomId;
console.log('room transcription '+roomId+' ==== ', msgJson) console.log('room transcription ' + roomId + ' ==== ', msgJson);
socket.emit('resume_data_'+roomId, msgJson); socket.emit('resume_data_' + roomId, msgJson);
} catch (err) { } catch (err) {
// Sometimes, the client will close the connection unexpectedly // Sometimes, the client will close the connection unexpectedly
// (e.g. when stopping). This is expected // (e.g. when stopping). This is expected
...@@ -167,9 +165,9 @@ module.exports = config => { ...@@ -167,9 +165,9 @@ module.exports = config => {
socket.on('new_user', async data => { socket.on('new_user', async data => {
const userId = data.userId; const userId = data.userId;
const roomId = data.roomId; const roomId = data.roomId;
resume.createFolder('_'+roomId); resume.createFolder('_' + roomId);
const streamData = resume.generateStream(roomId) const streamData = resume.generateStream(roomId);
let transcriptor; let transcriptor;
if (config.asd.isUse) { if (config.asd.isUse) {
...@@ -215,7 +213,6 @@ module.exports = config => { ...@@ -215,7 +213,6 @@ module.exports = config => {
return { return {
create: resume => { create: resume => {
//resume.createFolder();
const stompClient = createStompClient(); const stompClient = createStompClient();
audioSocket(resume); audioSocket(resume);
......
This diff is collapsed.
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