Initializes a TinyAudio instance with GPU compute capabilities for audio processing.
The GPU device used for creating buffers and compute pipelines
The WGSL shader source code for the compute pipeline
This constructor sets up:
The storage buffer size is calculated based on bufferSamples property (4 bytes per sample).
Gets the current playback time of the audio context.
The current time in seconds.
Plays audio using the Web Audio API scheduler pattern.
Resumes the audio context if it's suspended, then schedules audio buffer chunks to be played with a 0.5 second lookahead buffer. Each chunk is generated for both left and right channels and queued for playback.
Optionalcb: () => voidOptional callback function to execute immediately after scheduling begins
A promise that resolves after the scheduler is initiated
GPU-accelerated audio synthesizer that uses WebGPU compute shaders to generate audio samples.
Generates audio in chunks by dispatching compute work to the GPU, then reads back the results and schedules them for playback through the Web Audio API.
GPUSynth is originally written by Crush for SYTYCD 2025
Example