react-audio-voice-recorder
Version:
An audio recording helper for React. Provides a component and a hook to help with audio recording.
19 lines (18 loc) • 1.51 kB
TypeScript
import { ReactElement } from "react";
import { Props } from "./interfaces";
/**
* Usage: https://github.com/samhirtarif/react-audio-recorder#audiorecorder-component
*
*
* @prop `onRecordingComplete` Method that gets called when save recording option is clicked
* @prop `recorderControls` Externally initilize hook and pass the returned object to this param, this gives your control over the component from outside the component.
* https://github.com/samhirtarif/react-audio-recorder#combine-the-useaudiorecorder-hook-and-the-audiorecorder-component
* @prop `audioTrackConstraints`: Takes a {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings#instance_properties_of_audio_tracks subset} of `MediaTrackConstraints` that apply to the audio track
* @prop `onNotAllowedOrFound`: A method that gets called when the getUserMedia promise is rejected. It receives the DOMException as its input.
* @prop `downloadOnSavePress` If set to `true` the file gets downloaded when save recording is pressed. Defaults to `false`
* @prop `downloadFileExtension` File extension for the audio filed that gets downloaded. Defaults to `mp3`. Allowed values are `mp3`, `wav` and `webm`
* @prop `showVisualizer` Displays a waveform visualization for the audio when set to `true`. Defaults to `false`
* @prop `classes` Is an object with attributes representing classes for different parts of the component
*/
declare const AudioRecorder: (props: Props) => ReactElement;
export default AudioRecorder;