Commit b77c7c02 authored by Rudy BARAGLIA's avatar Rudy BARAGLIA
Browse files

Websocket based client-server communication

parent e8507a20
......@@ -27,4 +27,4 @@ ln -s $PATH_STT_Models $PWD/systems/
##### Create wavs & trans directory #####
mkdir wavs
mkdir trans
echo "Sucess..."
echo "Success..."
#!/bin/bash
. ./scripts/cmd.sh
. ./scripts/path.sh
. cmd.sh
. path.sh
# call sh ./decoding.sh ../systems/sys1
......
......@@ -4,4 +4,4 @@ docker build -t linagora/stt-offline .
# Start
Path_model=$1
port=$2
docker run --rm -it -p $port:5000 -v $Path_model:/opt/models linagora/stt-offline
docker run --rm -it -p $port:5000 -v $Path_model:/opt/models linagora/stt-offline
\ No newline at end of file
......@@ -53,13 +53,14 @@ class WorkerWebSocket(WebSocketClient):
# TODO: preprocessing ? (sox python)
if PREPROCESSING:
pass
# Offline decode call
# Offline decoder call
logging.debug(os.listdir('./wavs'))
logging.debug(DECODER_COMMAND + ' ' + TEMP_FILE_PATH + self.fileName+'.wav')
subprocess.call(DECODER_COMMAND + ' ' + TEMP_FILE_PATH + self.fileName+'.wav', shell=True)
# TODO: nettoyer les fichiers temporaires
subprocess.call("cd scripts; ./decode.sh ../systems/models "+self.fileName+".wav", shell=True)
# TODO: renvoyer la transcription au master
logging.debug(os.listdir('.'))
# Delete temporary files
# Check
if os.path.isfile('trans/decode_'+self.fileName+'.log'):
with open('trans/decode_'+self.fileName+'.log', 'r') as resultFile:
result = resultFile.read()
......
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