ts-audio
Version:
`ts-audio` is an agnostic and easy-to-use library to work with the `AudioContext` API and create Playlists.
14 lines (13 loc) • 464 B
TypeScript
declare global {
interface Window {
webkitAudioContext: typeof window.AudioContext;
}
}
/**
* Creates and returns a new AudioContext instance with cross-browser support.
* Attempts to use standard AudioContext first, falls back to webkitAudioContext for older browsers.
*
* @returns {AudioContext} A new AudioContext instance
* @throws {Error} If the browser doesn't support AudioContext
*/
export declare const AudioCtx: () => AudioContext;