Repository navigation
feat(wasm): add worklet-safe init and Float32 buffers - #47
Closed
google-labs-stitch[bot] wants to merge 3 commits into
Closed
google-labs-stitch[bot] wants to merge 3 commits into
google-labs-stitch[bot] wants to merge 3 commits into
Conversation
- Load an internal UTF-8 fallback before the Wasm glue runs - Export initTuneletSync for synchronous AudioWorklet initialization - Add f32 process and drain methods to Processor and Tunelet - Add applyMidi and applyCorrectionMidi for packed 3-byte MIDI slices - Add writeFeedback and writeTelemetry for flat Float32Array meters - Include the rejected rate and Web Audio guidance in sampleRate errors - Document AudioWorklet initialization, Float32 buffers and 48 kHz rate
- Keep the UTF-8 import and initSync alongside async Node.js loads - Share process_into and downmix in the f32 processor methods - Call Processor::check_block in the Float32 Wasm methods - Add the UTF-8 archive files to scripts/verify-pack.mjs
…bce4f3-79f5-4298-9329-247932680c48
Contributor
byteland-app
deleted the
stitch/feat/worklet-wasm-init-float32-jm0-cbbce4f3-79f5-4298-9329-247932680c48
branch
November 25, 2026 08:06
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds headless
AudioWorkletinitialization and zero-allocationFloat32ArrayandUint8Arrayprimitives across the Rust, WebAssembly and TypeScript APIs:initTuneletSync(module):src/utf8.tsinstalls a UTF-8TextDecoderandTextEncoderfallback whenglobalThisomits those classes (such as inAudioWorkletGlobalScope), andsrc/index.tsimports it beforepkg/tunelet.jsand exportsinitTuneletSync(module).Float32audio methods: Addsprocess_f32,process_planar_f32,process_mono_in_place_f32,drain_f32,drain_planar_f32anddrain_mono_f32toProcessor, andprocessFloat32,processMonoFloat32,drainFloat32anddrainMonoFloat32toTuneletwith reusableVec<f32>buffers.apply_midiandapply_correction_midi(applyMidiandapplyCorrectionMidiin TypeScript) that validate and decode 3-byte MIDI messages withMidiEvent::from_bytesbefore any state changes.Float32Arraymeter writers: Addswrite_feedback(8floats) andwrite_telemetry(45floats) (writeFeedbackandwriteTelemetryin TypeScript) with optional peak-window reset and zero Wasm heap allocations.sampleRateerror and Web Audio documentation: Reports the rejectedsampleRatevalue innew Tunelet(...)with{ sampleRate: 48000 }guidance, and updatesREADME.mdand rustdoc.Verification
cargo fmt --check,cargo build --locked --release,cargo clippy --locked --lib -- -D warnings,cargo doc --locked --no-depsandnpm run buildpass cleanly (along withwasm32-unknown-unknownclippy and rustdoc).AudioWorkletGlobalScopeVM (TextDecoder,TextEncoder,fetchandURLundefined) and real headless ChromiumOfflineAudioContext({ sampleRate: 48000 })+AudioWorklet(hasTextDecoder: false,hasTextEncoder: false,hasFetch: false).__wbindgen_malloccalls and zero JavaScriptObjectorArrayallocations across 128-frameprocessFloat32,applyMidi,applyCorrectionMidi,writeFeedbackandwriteTelemetry.Int16Arrayoutput preservation (process,processMono,drain,drainMono) against pre-change SHA-256 digests.Automated PR initiated by user @byteland-app via Stitch Loop.