Text-To-Speach für Linux hinzugefügt
This commit is contained in:
parent
44096c32cc
commit
bfed361bec
@ -139,7 +139,9 @@ module.exports = function(io, sql, async, app_cfg) {
|
|||||||
// Abschluss
|
// Abschluss
|
||||||
tts_text = tts_text + '. Ende der Durchsage!';
|
tts_text = tts_text + '. Ende der Durchsage!';
|
||||||
// Sprachansage als mp3 erstellen
|
// Sprachansage als mp3 erstellen
|
||||||
if (process.platform === "win32") {
|
switch (process.platform) {
|
||||||
|
//if (process.platform === "win32") {
|
||||||
|
case 'win32':
|
||||||
// Powershell
|
// Powershell
|
||||||
var proc = require('child_process');
|
var proc = require('child_process');
|
||||||
var commands = [
|
var commands = [
|
||||||
@ -171,8 +173,38 @@ module.exports = function(io, sql, async, app_cfg) {
|
|||||||
callback && callback(mp3_url);
|
callback && callback(mp3_url);
|
||||||
});
|
});
|
||||||
childD.stdin.end();
|
childD.stdin.end();
|
||||||
} else {
|
break;
|
||||||
sql.db_log('Fehler-TTS', 'OS ist nicht Windows');
|
case 'linux':
|
||||||
|
// bash
|
||||||
|
var proc = require('child_process');
|
||||||
|
var commands = [
|
||||||
|
// TTS-Schnittstelle SVOX PicoTTS
|
||||||
|
'-c', `
|
||||||
|
pico2wave --lang=de-DE --wave=` + wav_tts + ` \"` + tts_text + `\"
|
||||||
|
ffmpeg -nostats -hide_banner -loglevel 0 -y -i ` + wav_tts + ` -vn -ar 44100 -ac 2 -ab 128k -f mp3 ` + mp3_tmp + `
|
||||||
|
ffmpeg -nostats -hide_banner -loglevel 0 -y -i \"concat:` + mp3_bell + `|` + mp3_tmp + `\" -acodec copy ` + mp3_tts + `
|
||||||
|
rm ` + wav_tts + `
|
||||||
|
rm ` + mp3_tmp
|
||||||
|
];
|
||||||
|
var options = {
|
||||||
|
shell: true
|
||||||
|
};
|
||||||
|
console.log(commands);
|
||||||
|
var childD = proc.spawn('/bin/sh', commands);
|
||||||
|
childD.stdin.setEncoding('ascii');
|
||||||
|
childD.stderr.setEncoding('ascii');
|
||||||
|
childD.stderr.on('data', function(data) {
|
||||||
|
sql.db_log('Fehler-TTS', data);
|
||||||
|
callback && callback(null);
|
||||||
|
});
|
||||||
|
childD.on('exit', function() {
|
||||||
|
callback && callback(mp3_url);
|
||||||
|
});
|
||||||
|
childD.stdin.end();
|
||||||
|
break;
|
||||||
|
// } else {
|
||||||
|
default:
|
||||||
|
sql.db_log('Fehler-TTS', 'TTS für dieses Server-Betriebssystem nicht verfügbar');
|
||||||
callback && callback(null);
|
callback && callback(null);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user