react-voice-recorder-pro
Version:
A powerful React hook-based voice recording library with real-time audio visualization and comprehensive browser support
18 lines • 715 B
TypeScript
/**
* Custom hook that calculates RMS level (0..1) based on time-domain waveform of microphone stream
*
* Key features:
* - Configures AnalyserNode internally and polls in real-time with requestAnimationFrame
* - Provides basic analysis parameters like smoothing, fftSize for audio analysis quality control
* - Safely cleans up on stream/context changes or component unmount to prevent memory leaks
* - Accurate audio level measurement based on RMS (Root Mean Square)
*/
export declare function useAudioMeter(params: {
audioContext: AudioContext | null;
stream: MediaStream | null;
smoothing?: number;
fftSize?: number;
}): {
level: number;
};
//# sourceMappingURL=useAudioMeter.d.ts.map