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

@@ -20,27 +20,35 @@ RUN apk add --no-cache \
make \
python3
# Download and extract Weatherscan music
# Download and extract Weatherscan music with fast quality processing
RUN mkdir -p /music /music-temp && \
echo "Downloading Weatherscan music..." && \
wget -O /tmp/weatherscan.zip "https://archive.org/compress/weatherscancompletecollection/formats=OGG%20VORBIS&file=/weatherscancompletecollection.zip" && \
echo "Extracting OGG files..." && \
unzip -j /tmp/weatherscan.zip "*.ogg" -d /music-temp && \
rm /tmp/weatherscan.zip && \
echo "Repairing and validating music files (fast parallel processing)..." && \
echo "Processing music (fast parallel)..." && \
cd /music-temp && \
JOBS=0 && MAX_JOBS=12 && \
JOBS=0 && MAX_JOBS=16 && \
for file in *.ogg; do \
while [ $JOBS -ge $MAX_JOBS ]; do \
wait -n 2>/dev/null && JOBS=$((JOBS-1)) || JOBS=0; \
done; \
(ffmpeg -y -v error -i "$file" -c:a libvorbis -b:a 128k "/music/$file" 2>&1 && echo "$file" || echo "$file") & \
(ffmpeg -y -v error -i "$file" \
-c:a libvorbis \
-q:a 5 \
-ar 44100 \
-ac 2 \
-compression_level 4 \
"/music/$file" 2>&1 && echo "$file" || echo "$file") & \
JOBS=$((JOBS+1)); \
done && \
wait && \
cd / && rm -rf /music-temp && \
echo "Music files ready: $(ls -1 /music/*.ogg 2>/dev/null | wc -l) files" && \
echo "Weatherscan music setup complete!"
echo "════════════════════════════════════════" && \
echo "Music ready: $(ls -1 /music/*.ogg 2>/dev/null | wc -l) files" && \
echo "🎵 Quality: VBR q5 (~160kbps), 44.1kHz stereo" && \
echo "════════════════════════════════════════"
# Set Puppeteer to use installed Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
@@ -58,5 +66,5 @@ COPY src/ ./src/
# Expose both ports
EXPOSE 3000 8080
# Start both services
CMD cd /app && node index.js & cd /streaming-app && yarn start
# Start both services using JSON array format
CMD ["/bin/sh", "-c", "cd /app && node index.js & cd /streaming-app && yarn start"]