ScrollAudio
lib/scroll/audio.march — Emit audio blobs via the __SCROLL_BLOB__ sentinel protocol.
User code calls these helpers to play audio in the notebook:
ScrollAudio.wav(b64_data) -- play a WAV file
ScrollAudio.mp3(b64_data) -- play an MP3 file
ScrollAudio.ogg(b64_data) -- play an OGG file
ScrollAudio.show(mime, b64)-- play any audio MIME typeThe browser renders the blob as <audio controls src="data:<mime>;base64,<b64>">.
Functions
Build the raw sentinel string for an audio blob (for testing / composing).
Play an MP3 audio file. b64 is the base64-encoded MP3 bytes.
Play an OGG audio file. b64 is the base64-encoded OGG bytes.
Play audio with the given MIME type in the notebook output.
b64 must be a valid base64-encoded representation of the audio bytes. The browser renders the result as <audio controls src="data:<mime>;base64,<b64>">.
Examples
march> ScrollAudio.show("audio/wav", "UklGR...")
()Play a WAV audio file. b64 is the base64-encoded WAV bytes.