From f28c4b4a848f8bbc2ba3fc1391684e427b9f7249 Mon Sep 17 00:00:00 2001 From: Yotam Mann Date: Thu, 16 Apr 2020 14:44:48 -0400 Subject: [PATCH] exports std-audio-context's isSupported method --- Tone/core/context/AudioContext.ts | 9 ++++++++- Tone/index.ts | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Tone/core/context/AudioContext.ts b/Tone/core/context/AudioContext.ts index 26dbad3e..0f6dfb6c 100644 --- a/Tone/core/context/AudioContext.ts +++ b/Tone/core/context/AudioContext.ts @@ -1,7 +1,7 @@ import { AudioContext as stdAudioContext, AudioWorkletNode as stdAudioWorkletNode, - OfflineAudioContext as stdOfflineAudioContext, + OfflineAudioContext as stdOfflineAudioContext } from "standardized-audio-context"; import { assert } from "../util/Debug"; import { isDefined } from "../util/TypeCheck"; @@ -51,3 +51,10 @@ export function createAudioWorkletNode(context: AnyAudioContext, name: string, o // @ts-ignore return new stdAudioWorkletNode(context, name, options); } + +/** + * This promise resolves to a boolean which indicates if the + * functionality is supported within the currently used browse. + * Taken from [standardized-audio-context](https://github.com/chrisguttandin/standardized-audio-context#issupported) + */ +export { isSupported as supported } from "standardized-audio-context"; diff --git a/Tone/index.ts b/Tone/index.ts index c3d78310..2dc49dc4 100644 --- a/Tone/index.ts +++ b/Tone/index.ts @@ -5,6 +5,7 @@ import { getContext } from "./core/Global"; import { ToneAudioBuffer } from "./core/context/ToneAudioBuffer"; export { start } from "./core/Global"; import { Seconds } from "./core/type/Units"; +export { supported } from "./core/context/AudioContext"; /** * The current audio context time of the global [[Context]].