mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-07-30 16:59:15 +02:00
bugfix for audio crash
This commit is contained in:
@@ -25,6 +25,7 @@ const { logDebug, logError, logInfo, logWarn } = require('./console');
|
|||||||
const storage = require('./storage');
|
const storage = require('./storage');
|
||||||
const { configName, serverConfig, configUpdate, configSave } = require('./server_config');
|
const { configName, serverConfig, configUpdate, configSave } = require('./server_config');
|
||||||
const pjson = require('../package.json');
|
const pjson = require('../package.json');
|
||||||
|
require('./stream/index');
|
||||||
|
|
||||||
console.log(`\x1b[32m
|
console.log(`\x1b[32m
|
||||||
_____ __ __ ______ __ __ __ _
|
_____ __ __ ______ __ __ __ _
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const fs_1 = require("fs");
|
|||||||
const child_process_1 = require("child_process");
|
const child_process_1 = require("child_process");
|
||||||
const ws = __importStar(require("ws"));
|
const ws = __importStar(require("ws"));
|
||||||
const wrtc = require('wrtc');
|
const wrtc = require('wrtc');
|
||||||
const Settings = JSON.parse((0, fs_1.readFileSync)('stream/settings.json', 'utf-8'));
|
const Settings = JSON.parse((0, fs_1.readFileSync)('server/stream/settings.json', 'utf-8'));
|
||||||
const FFmpeg_command = (() => {
|
const FFmpeg_command = (() => {
|
||||||
if (process.platform === 'win32')
|
if (process.platform === 'win32')
|
||||||
return Settings.FallbackFFmpegPath;
|
return Settings.FallbackFFmpegPath;
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ function enableAudioStream() {
|
|||||||
// Combine all the settings for the ffmpeg command
|
// Combine all the settings for the ffmpeg command
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
// Windows
|
// Windows
|
||||||
ffmpegCommand = `${flags} -f dshow -audio_buffer_size 50 -i audio="${serverConfig.audio.audioDevice}" ${codec} ${output} pipe:1 | node stream/3las.server.js -port ${serverConfig.webserver.webserverPort + 10} -samplerate 48000 -channels ${serverConfig.audio.audioChannels}`;
|
ffmpegCommand = `${flags} -f dshow -audio_buffer_size 50 -i audio="${serverConfig.audio.audioDevice}" ${codec} ${output} pipe:1 | node server/stream/3las.server.js -port ${serverConfig.webserver.webserverPort + 10} -samplerate 48000 -channels ${serverConfig.audio.audioChannels}`;
|
||||||
} else {
|
} else {
|
||||||
// Linux
|
// Linux
|
||||||
ffmpegCommand = `${flags} -f alsa -i "${serverConfig.audio.softwareMode && serverConfig.audio.softwareMode == true ? 'plug' : ''}${serverConfig.audio.audioDevice}" ${codec} ${output} pipe:1 | node stream/3las.server.js -port ${serverConfig.webserver.webserverPort + 10} -samplerate 48000 -channels ${serverConfig.audio.audioChannels}`;
|
ffmpegCommand = `${flags} -f alsa -i "${serverConfig.audio.softwareMode && serverConfig.audio.softwareMode == true ? 'plug' : ''}${serverConfig.audio.audioDevice}" ${codec} ${output} pipe:1 | node server/stream/3las.server.js -port ${serverConfig.webserver.webserverPort + 10} -samplerate 48000 -channels ${serverConfig.audio.audioChannels}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
consoleCmd.logInfo("Using audio device: " + serverConfig.audio.audioDevice);
|
consoleCmd.logInfo("Using audio device: " + serverConfig.audio.audioDevice);
|
||||||
|
|||||||
Reference in New Issue
Block a user