ts-audio
Version:
`ts-audio` is an agnostic and easy-to-use library to work with the `AudioContext` API and create Playlists.
22 lines (20 loc) • 433 B
text/typescript
/**
* Type definition for the audio player's internal state.
*/
export type AudioState = {
isDecoded: boolean
isPlaying: boolean
hasStarted: boolean
source: AudioBufferSourceNode | null
gainNode: GainNode | null
}
/**
* Default initial state for audio decoding and playback.
*/
export const defaultStates: AudioState = {
isDecoded: false,
isPlaying: false,
hasStarted: false,
source: null,
gainNode: null,
}