Web Audio playback queue (gapless, cancellable) #7
Labels
No labels
NaNs
area/audio
area/build
area/docs
area/dsh
area/engine
area/security
area/ui
needs-operator
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-whale-noises#7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Gapless, cancellable playback of synthesized chunks through Web Audio — the part users judge instantly.
Scope
AudioQueue: lazily create oneAudioContext; exposeunlock()to be called from a user gesture (autoplay policy),resume()/suspend().enqueue(AudioBuffer)schedules withsource.start(when)wherewhen = max(prevEnd, ctx.currentTime); trackprevEnd; emitspeaking/idlestate.stop()cancels scheduled sources and clears the queue;setRate(0.5–2.0)andsetVolume(0–1)viaplaybackRate/GainNode;dispose()closes the context.decodeAudio(ArrayBuffer)for mp3/wav; PCM f32 →AudioBufferat native sample rate (24 kHz for local engines).ended.Acceptance
Notes
docs/research/tts-engines.md§7.Done in
023e5a6(queue) +ef4dae5(decode helpers). 12 queue tests + 5 decode tests: monotonicstart(when), look-ahead cap, rate/volume, stop/dispose, suspended state, WAV decode and PCM→AudioBuffer. CI run #3 and #4 green.Follow-up owned by #10: the Piper adapter should feed
decodeAudio(ctx, wavBuffer)intoqueue.enqueue(); unlock must happen in a user gesture.