feat: set DroidDeck startup movie by default (#25)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-09-25 23:36:29 -04:00
1 parent c3b0d8ef03
commit d4cf890d8a
9 files changed
+1211

No files matched your search

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
"""Embed droiddeck-boot-sound.wav into droiddeck-boot.html (MP3, base64) for the preview page."""
import base64, re, subprocess
from pathlib import Path
here = Path(__file__).parent
subprocess.run(["ffmpeg", "-y", "-loglevel", "error", "-i", str(here / "droiddeck-boot-sound.wav"),
"-c:a", "libmp3lame", "-b:a", "128k", str(here / "_snd.mp3")], check=True)
b64 = base64.b64encode((here / "_snd.mp3").read_bytes()).decode(); (here / "_snd.mp3").unlink()
html = (here / "droiddeck-boot.html").read_text()
html = re.sub(r'/\*SOUND\*/".*?"/\*END\*/', lambda m: f'/*SOUND*/"{b64}"/*END*/', html, flags=re.S)
(here / "droiddeck-boot.html").write_text(html)
print(f"embedded {len(b64)/1024:.0f} KB of sound")