This is a voice recorder with time duration.
To install via npm.
npm install react-duration-voice-recorder
import ReactDurationRecorder from 'react-duration-voice-recorder'
const MyComponent = () => {
return (
<ReactDurationRecorder
getFile={(file) => console.log(file)}
getUrl={(url) => console.log(url)}
showPreview={true}
timer={true}
btnClass='your button classname'
containerStyle={{
width: '300px',
border: '1px solid black',
padding: '10px'
}}
duration={{
hours: 0,
minutes: 0,
seconds: 30
}}
/>
)
}
- React
- react-media-recorder
- react-icons
- getFile : (REQUIRED) requires function that accepts file on clicking upload button
- getUrl : (REQUIRED) requires a function that accepts the blog url
- showPreview: (OPTIONAL)(boolean) shows audio element for preview. default will be true
- timer: (OPTIONAL)(boolean) shows timer while recording. default will be true
- btnClass: (OPTIONAL)(string) No default styles provided. Add classNames here
- containerStyle: (OPTIONAL)(object). Outer container. Accepts styleObject.
- duration: (OPTIONAL) (object). requires objects with keys hours(int),minutes(int),seconds(int). default will be 30 seconds
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.