tone 15.0.1 → 15.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,6 +41,8 @@ export type AnyAudioContext = AudioContext | OfflineAudioContext;
41
41
  interface ToneWindow extends Window {
42
42
  TONE_SILENCE_LOGGING?: boolean;
43
43
  TONE_DEBUG_CLASS?: string;
44
+ BaseAudioContext: any;
45
+ AudioWorkletNode: any;
44
46
  }
45
47
 
46
48
  /**
@@ -66,10 +68,13 @@ export function createAudioWorkletNode(
66
68
  ): AudioWorkletNode {
67
69
  assert(
68
70
  isDefined(stdAudioWorkletNode),
69
- "This node only works in a secure context (https or localhost)"
71
+ "AudioWorkletNode only works in a secure context (https or localhost)"
70
72
  );
71
- // @ts-ignore
72
- return new stdAudioWorkletNode(context, name, options);
73
+ return new (
74
+ context instanceof theWindow?.BaseAudioContext
75
+ ? theWindow?.AudioWorkletNode
76
+ : stdAudioWorkletNode
77
+ )(context, name, options);
73
78
  }
74
79
 
75
80
  /**
package/Tone/version.ts CHANGED
@@ -1 +1 @@
1
- export const version: string = "15.0.1";
1
+ export const version: string = "15.0.2";