MCPcopy
hub / github.com/andremichelle/openDAW / createFor

Method createFor

packages/studio/core/src/AudioWorklets.ts:21–27  ·  view source on GitHub ↗
(context: BaseAudioContext)

Source from the content-addressed store, hash-verified

19 static #workletUrl: Option<string> = Option.None
20
21 static async createFor(context: BaseAudioContext): Promise<AudioWorklets> {
22 return context.audioWorklet.addModule(this.#workletUrl.unwrap("WorkletUrl is missing (call 'install' first)")).then(() => {
23 const worklets = new AudioWorklets(context)
24 this.#map.set(context, worklets)
25 return worklets
26 })
27 }
28
29 static get(context: BaseAudioContext): AudioWorklets {return asDefined(this.#map.get(context), "Worklets not installed")}
30

Callers 2

startFunction · 0.80
bootFunction · 0.80

Calls 3

addModuleMethod · 0.65
unwrapMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected