Commit 33334800 authored by Yoann HOUPERT's avatar Yoann HOUPERT

add merged file

parent 09af1645
Pipeline #13791 failed with stage
MODELS_PATH=./models/
MODELS_PATH=./models/current_model/model/
MODEL_PATH_OFFLINE=./models/current_model/
OFFLINE_PORT=9050
YAML=/opt/models/gmm_hmm3.yaml
NB_WORKERS=2
......@@ -61,6 +61,7 @@
"srate": 16000
},
"host": "hublot_offline_1",
"port": 9999
"port": 9999,
"model": "current_model"
}
}
......@@ -19,6 +19,7 @@
*/
const fs = require('fs');
const uuidv1 = require('uuid/v1');
const request = require('request');
const ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
const ffprobeInstaller = require('@ffprobe-installer/ffprobe');
......@@ -35,6 +36,9 @@ module.exports = config => {
let timestamp = undefined;
let userConf = 0;
function offlineTranscription(){
//TODO
}
function resumeGenerator(){
let nbFile = 0;
......@@ -45,6 +49,9 @@ module.exports = config => {
})
cmd.complexFilter('amix=inputs='+nbFile+':duration=first:dropout_transition=3')
.save(config.folder.audioMerged+"/merged.wav")
.on('end', function() {
})
}
......@@ -81,13 +88,14 @@ module.exports = config => {
streamData.wstream.close();
let delay = ((timestamp - streamData.timestamp) / toSecond) * -1;
try{
console.log('generate silence')
ffmpeg()
.input('anullsrc=sample_rate='+config.audio.srate)
.inputFormat('lavfi')
.duration(delay)
.output(config.folder.audioWav+"/silence_"+streamData.fileName+".wav")
.on('end', function() {
console.log('generate audio file')
ffmpeg(streamData.pathFile)
.toFormat(config.audio.format)
.noVideo()
......@@ -95,7 +103,12 @@ module.exports = config => {
.audioChannels(config.audio.channels)
.audioFrequency(config.audio.srate)
.save(config.folder.audioWav+"/"+streamData.fileName+".wav")
.on('error', function(err) {
--userConf
console.log('An error occurred: ' + err.message);
})
.on('end', function() {
console.log('merge audio and silence')
ffmpeg()
.input(config.folder.audioWav+"/silence_"+streamData.fileName+".wav")
.input(config.folder.audioWav+"/"+streamData.fileName+".wav")
......
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