Repository navigation
feat(npm): add TypeScript AudioWorklet adapter - #67
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
- Export tunelet/worklet in package.json and tsconfig.json - Add a UTF-8 shim for TextDecoder and TextEncoder in worklets - Add TuneletWorkletProcessor with reusable Int16Array buffers - Resample non-native AudioContext rates to and from 48 kHz - Throttle feedback and telemetry reports to a UI interval - Export createTuneletNode with typed control methods - Document the AudioWorklet adapter in README.md
- Resolve the import conflict in src/index.ts. - Initialize Wasm asynchronously in createTuneletNode. - Add the worklet files and exports to scripts/verify-pack.mjs.
- Merge the latest commits from main into the feature branch.
Contributor
byteland-app
deleted the
stitch/feat-ts-audioworklet-adapter-jm0-1abc26fd-1fd1-48e7-884d-c3c6ed6475bc
branch
November 25, 2026 08:05
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
tunelet/workletinpackage.jsonand compilesrc/worklet.tsintsconfig.jsonalongsidesrc/index.ts.src/utf8-shim.tsto install UTF-8TextDecoderandTextEncodershims inAudioWorkletGlobalScopebeforepkg/tunelet.jsloads.TuneletWorkletProcessorinsrc/worklet.tswith constructor-allocatedInt16Arraybuffers and prefix views soprocess()makes zeroInt16Array.prototype.subarrayallocations.AudioContextrates (such as 88.2 kHz and 96 kHz) to an internal 48 kHzTuneletinstance through a stateful block resampler with anti-alias filtering above 48 kHz.feedbackandtelemetryallocations andMessagePortposts to a configurable UI report interval (50ms by default).createTuneletNode(context, options?)andTuneletWorkletNodefromsrc/index.tsto compile and cachetunelet_bg.wasmon the main thread, registertunelet/worklet, and expose typedsetConfig,sendEvent,sendEvents,reset,beginDrain,setReporting, anddisposecontrols.createTuneletNodeandtunelet/workletinREADME.md.Verification
git diff src/*.rs Cargo.tomlis empty;cargo build --locked --release,cargo fmt --check,cargo clippy --locked --lib -- -D warnings, andcargo doc --locked --no-depspass with zero warnings.npm run buildcompiles the Wasm bindings and TypeScript entry points with zero errors, and a standalone consumer TypeScript check (types: [],lib: ["ES2020", "ESNext.Disposable", "DOM"]) passes cleanly.dist/worklet.jsin an isolated VM context withoutTextDecoder,TextEncoder, orfetch, and audited all 11 Web Audio sample rates (8000–192000Hz):0user PCMsubarrayallocations per second (down from2,250/sat 96 kHz) and20throttled UI reports/s at50ms.createTuneletNoderendering in headless Chromium Web Audio across44.1 kHz,48 kHz,88.2 kHz, and96 kHzOfflineAudioContextgraphs:Automated PR initiated by user @byteland-app via Stitch Loop.