sound-visualizer
Version:
27 lines (24 loc) • 968 B
text/typescript
export { clearCanvas } from '../common/draw/impure.mjs';
export { drawContinuousWave } from '../continuous/draw/impure.mjs';
export { drawCurrentWave } from '../current/draw/impure.mjs';
import '../continuous/draw/options.mjs';
import '../common/draw/options.mjs';
import '../current/draw/options.mjs';
/**
* 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 };