This commit is contained in:
Robert Richter 2020-01-18 10:40:30 +01:00
parent 3cfd48a807
commit 6f6fd88e67
7 changed files with 24406 additions and 15 deletions

13
.foreverignore Normal file
View File

@ -0,0 +1,13 @@
node_modules/*
public/*
views/*
misc/*
*.html
*.jpeg
*.png
*.mp3
*.wav
*.md
*.sqlite3
*-journal
sessions

3
.gitignore vendored
View File

@ -75,9 +75,6 @@ typings/
# FuseBox cache
.fusebox/
# Forever
.foreverignore
# old Scripts
_old/

24378
misc/hexagon_brb_2km.geojson Executable file

File diff suppressed because it is too large Load Diff

View File

@ -5,8 +5,8 @@ var app = express();
var http = require('http') //.Server(app);
var https = require('https'); //.Server(app);
var webserver = https.createServer({
key: fs.readFileSync('./server/server.key', 'utf8'),
cert: fs.readFileSync('./server/server.cert', 'utf8')
key: fs.readFileSync('./misc/server.key', 'utf8'),
cert: fs.readFileSync('./misc/server.cert', 'utf8')
}, app);
var io = require('socket.io').listen(webserver);
var async = require('async');

View File

@ -54,9 +54,11 @@ module.exports = function(io, sql, async, app_cfg) {
sql.db_update_client_status(io.sockets.sockets[socket_id], waip_id);
// Sound erstellen
tts_erstellen(app_cfg, socket_id, einsatzdaten, function(tts) {
// Sound senden
sql.db_log('WAIP', 'ttsfile: ' + tts);
io.sockets.to(socket_id).emit('io.playtts', tts);
if (tts) {
// Sound senden
sql.db_log('WAIP', 'ttsfile: ' + tts);
io.sockets.to(socket_id).emit('io.playtts', tts);
};
});
});
} else {
@ -179,12 +181,13 @@ module.exports = function(io, sql, async, app_cfg) {
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.on('exit', function(code, signal) {
if (code > 0) {
sql.db_log('Fehler-TTS', 'Exit-Code '+ code +'; Fehler beim erstellen der TTS-Datei');
callback && callback(null);
} else {
callback && callback(mp3_url);
};
});
childD.stdin.end();
break;