This workspace contains a browser-only Angular app that slices large WAV files into MP3 tracks without a Node server.
- Streams WAV input with the File API and parses PCM incrementally instead of loading the whole file into memory.
- Detects song regions by watching dB level transitions between
SILENCEandSONGwindows. - Encodes each detected song to MP3 in a Web Worker with
lamejs. - Transcribes quiet intro gaps and uses the text before each song to name the next MP3 file.
- Exposes track and segment state to compatible browser agents through WebMCP.
- Primary path: Chrome Prompt API for on-device audio transcription and title extraction.
- Fallback path: Gemini API when the user provides an API key.
- No mock transcript fallback: if neither provider is available, tracks are still sliced and exported, but silent-gap transcription will fail and titles stay generic.
ffmpeg.wasm is useful when you need broad codec support or exact FFmpeg parity. This app only needs streamed WAV parsing plus MP3 encoding, so a custom WAV stream parser and a lightweight MP3 worker keep memory use lower and the bundle simpler for a serverless deployment.
npx nx serve web-audio-slicernpx nx build web-audio-slicerThe production bundle is emitted to dist/apps/web-audio-slicer and can be hosted as static files.
- Large WAV files are processed incrementally, but quiet gaps still need to be buffered temporarily for transcription.
- Prompt API audio support depends on the local Chrome build and device capabilities.
- WebMCP registration is optional and activates only when the browser exposes a model context API.