Skip to content

webapp fix added - #11

Merged
Ojas1804 merged 1 commit into
mainfrom
feature/webapp_fix
Jun 20, 2026
Merged

Ojas1804 merged 1 commit into
mainfrom
feature/webapp_fix

Conversation

@Ojas1804

Copy link
Copy Markdown
Owner

No description provided.

@Ojas1804
Ojas1804 requested a review from Copilot June 20, 2026 17:03
@Ojas1804
Ojas1804 merged commit db6117e into main Jun 20, 2026
2 of 3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR rewrites the embedded web UI/server in webapp.py to improve “phone browser over LAN” synced playback, shifting the browser playback implementation to HTML5 <audio> with SSE-driven session events and adding HTTP Range support for seeking/late-join sync. It also tweaks mp3_to_wav() in utils.py to accept an optional output path.

Changes:

  • Replaced the embedded frontend (HTML/CSS/JS) with a new UI flow including an audio-unlock banner, SSE session handling, and file scanning/play controls.
  • Added server-side audio streaming with HTTP Range support (/audio/<session_id>) and a simplified status/files API.
  • Updated mp3_to_wav() signature to make the wav_path parameter optional.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
webapp.py Major webapp/server + embedded frontend rewrite; adds Range-based audio streaming and SSE session notifications for browser playback.
utils.py Adjusts mp3_to_wav() signature to make the output path optional (but currently needs a correctness fix).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread webapp.py
Comment on lines +29 to +32
# Extensions listed in the UI and served to browsers.
# MP3/M4A are included: the browser decodes them natively, and the Node's
# host.py converts them to WAV for local sounddevice playback automatically.
AUDIO_EXTENSIONS = {".aiff", ".aif", ".flac", ".m4a", ".mp3", ".oga", ".ogg", ".wav"}
Comment thread webapp.py
Comment on lines +789 to +790
start = int(s_str) if s_str.strip() else 0
end = int(e_str) if e_str.strip() else total - 1
Comment thread webapp.py
Comment on lines +487 to +490
} else if (elapsed < audio.duration - 0.5) {
// Late join — seek into the track to stay in sync
const target = Math.min(elapsed + 0.15, audio.duration - 0.1);
audio.currentTime = target;
Comment thread webapp.py
}
} catch (_) {}
};
es.onerror = () => setTimeout(connectEvents, 3000);
Comment thread utils.py
Comment on lines +109 to 112
def mp3_to_wav(mp3_path: str, wav_path: str = "") -> str:
wav_path = mp3_path.replace(".mp3", ".wav")
decoder = miniaudio.mp3_stream_file_iterative(mp3_path)
miniaudio.stream_file_wav(decoder, wav_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants