react-voice-recorder-pro
Version:
A powerful React hook-based voice recording library with real-time audio visualization and comprehensive browser support
26 lines • 864 B
TypeScript
type RecorderState = {
isRecording: boolean;
isPaused: boolean;
chunks: Blob[];
mimeType: string;
start: () => void;
pause: () => void;
resume: () => void;
stop: () => Promise<Blob | null>;
reset: () => void;
error: string | null;
};
/**
* Custom hook for audio recording based on MediaRecorder API
*
* Key features:
* - Provides start/stop/pause/resume recording functionality
* - Collects audio data chunks through dataavailable events
* - Creates final audio file in Blob format
* - Automatically cleans up previous recorder when stream changes to prevent memory leaks
* - Error handling and state management
*/
export declare function useMediaRecorder(stream: MediaStream | null, // Media stream to record
options?: MediaRecorderOptions): RecorderState;
export {};
//# sourceMappingURL=useMediaRecorder.d.ts.map