Skip to content

Add example for AudioWorklet module creation #2811

@orispok

Description

@orispok

Is your feature request related to a problem? Please describe.
There is currently no official Kotlin/JS example demonstrating how to create and load an AudioWorklet module. This gap complicates splitting processor code into separate files and properly loading them with audioContext.audioWorklet.addModule(), especially given bundling challenges.

Describe the solution you'd like
Provide a clear example showing how to implement and load an AudioWorklet processor module in Kotlin/JS, covering best practices for bundling (e.g., with Vite or Webpack loaders).

Describe alternatives you've considered
Users typically resort to inline JS blobs or complex custom bundler setups without official guidance or examples.

Additional context
Slack discussion

JS example
script.js
await audioContext.audioWorklet.addModule("hiss-generator.js");
hiss-generator.js
registerProcessor("hiss-generator", HissGeneratorProcessor);

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions