diff --git a/audio/context/context.node.ts b/audio/context/context.node.ts deleted file mode 100644 index f9d16ee18a2..00000000000 --- a/audio/context/context.node.ts +++ /dev/null @@ -1,34 +0,0 @@ -namespace $ { - - type AudioContextNode = { - outStream?: NodeJS.WriteStream | null - format: { - numberOfChannels: number - bitDepth: number - } - } - - export class $mol_audio_context_node extends $mol_audio_context { - - static override create_context(): AudioContext & AudioContextNode { - const AudioContext = this.$.$node['web-audio-api'].AudioContext - return new AudioContext() - } - - @ $mol_memo.method - static override context() { - const context = this.create_context() - - // const Speaker = this.$.$node.speaker - // context.outStream = new Speaker({ - // channels: context.format.numberOfChannels, - // bitDepth: context.format.bitDepth, - // sampleRate: context.sampleRate - // }) - - return context - } - } - - $.$mol_audio_context = $mol_audio_context_node -} diff --git a/audio/context/context.ts b/audio/context/context.ts index d74944de55c..ffc68e51902 100644 --- a/audio/context/context.ts +++ b/audio/context/context.ts @@ -1,12 +1,8 @@ namespace $ { export class $mol_audio_context extends $mol_object2 { - static create_context() { - return new this.$.$mol_dom_context.AudioContext() - } - @ $mol_memo.method static context() { - return this.create_context() + return new this.$.$mol_dom_context.AudioContext() || this.$.$node['web-audio-api'].AudioContext } } }