1
0

Add audio validation, seamless transitions, and quality improvements for music streaming

This commit is contained in:
2025-11-12 10:54:25 -05:00
parent 86a79d0cc0
commit 1f89e8d243
7 changed files with 191 additions and 64 deletions

View File

@@ -1,6 +1,7 @@
const express = require('express');
const { streamHandler } = require('./src/streamHandler');
const { geocodeCity } = require('./src/geocode');
const { getAllMusicFiles } = require('./src/musicPlaylist');
const app = express();
const PORT = process.env.PORT || 3000;
@@ -188,4 +189,15 @@ app.listen(PORT, () => {
console.log(`Webpage to HLS server running on port ${PORT}`);
console.log(`Usage: http://localhost:${PORT}/stream?url=http://example.com`);
console.log(`Weather: http://localhost:${PORT}/weather?city=YourCity`);
// Pre-validate music files on startup to cache results
if (MUSIC_PATH) {
console.log(`\n🎵 Pre-validating music library at ${MUSIC_PATH}...`);
const validFiles = getAllMusicFiles(MUSIC_PATH);
if (validFiles.length > 0) {
console.log(`✅ Music library ready: ${validFiles.length} valid tracks cached\n`);
} else {
console.log(`⚠️ No valid music files found in ${MUSIC_PATH}\n`);
}
}
});