UNPKG

sound-visualizer

Version:
27 lines (24 loc) 962 B
export { clearCanvas } from '../common/draw/impure.js'; export { drawContinuousWave } from '../continuous/draw/impure.js'; export { drawCurrentWave } from '../current/draw/impure.js'; import '../continuous/draw/options.js'; import '../common/draw/options.js'; import '../current/draw/options.js'; /** * Takes all the necessary steps to get the byteTimeDomainData analysis for a MediaStream, * returning two functions that analyse the audio at a given moment. * * @param audio the audio to analyse * * @returns * // an analysis function, which returns a Uint8Array with data for the current audio * // and a disconnecting function, to be called when the analysis is no longer needed * { analyse: () => Uint8Array, disconnect: () => void } * * @impure this function connects to (and alters) global state **/ declare function startAnalysis(audio: MediaStream): { analyse: () => Uint8Array; disconnect: () => void; }; export { startAnalysis };