Add continuous mixer stream and sound sets
This commit is contained in:
@@ -7,6 +7,7 @@ const { loadConfig } = require('./config');
|
||||
const { FilestashClient } = require('./filestash');
|
||||
const { EffectsService } = require('./effects');
|
||||
const { HomeAssistantClient } = require('./homeassistant');
|
||||
const { StreamMixer } = require('./streamMixer');
|
||||
const { createApiRouter } = require('./routes');
|
||||
|
||||
function buildApp(config) {
|
||||
@@ -48,6 +49,11 @@ function buildApp(config) {
|
||||
};
|
||||
}
|
||||
|
||||
const mixer = new StreamMixer({
|
||||
effects,
|
||||
localMediaBaseUrl: `http://127.0.0.1:${config.env.port}`,
|
||||
});
|
||||
|
||||
const app = express();
|
||||
app.disable('x-powered-by');
|
||||
|
||||
@@ -66,7 +72,7 @@ function buildApp(config) {
|
||||
});
|
||||
}
|
||||
|
||||
app.use(createApiRouter({ config, effects, filestash, ha }));
|
||||
app.use(createApiRouter({ config, effects, filestash, ha, mixer }));
|
||||
|
||||
const publicDir = path.join(__dirname, '..', 'public');
|
||||
app.use(express.static(publicDir, { fallthrough: true, index: 'index.html' }));
|
||||
@@ -82,7 +88,7 @@ function buildApp(config) {
|
||||
res.status(status).json({ error: err.message || 'internal error' });
|
||||
});
|
||||
|
||||
return { app, effects, filestash };
|
||||
return { app, effects, filestash, mixer };
|
||||
}
|
||||
|
||||
function main() {
|
||||
|
||||
Reference in New Issue
Block a user