Alternatives to Lookahead Audio Scheduling
MetadataShow full item record
The scheduling of web audio events occurs in the UI thread, which is optimized to respond to user input and to provide visual feedback. The setTimeout and setInterval interfaces provide an imprecise method of scheduling, and in background tabs the UI thread virtually ceases. Lookahead scheduling (à la “A Tale of Two Clocks”) is an established audio scheduling strategy, though it relies on the UI thread running continually. This talk surveys alternative scheduling strategies, including all-at-once scheduling and the pre-rendering of audio using the OfflineAudioContext (as described in “A Tale of No Clocks”), which tie the burden on the UI thread closely to user interactions. I discuss the general pattern pre-rendering implies through a demonstration of a proof-of-concept implementation, and explore the range of applications that suit pre-rendering, including the smallest of loop-based web tools (e.g. metronomes) and large-scale DAW projects where pre-rendering provides the added benefit of reducing computational demand during playback.