1.1.0 • Published 1 year ago

audio-utilis v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

audio-utilis

can record,play,stop and cleanup

Installation

npm install audio-utilis

Usage

import { StartRecording, StopRecording, PlayRecordedFile, CleanUpFiles, PauseRecordedFile, ResumeRecordedFile, StopWhilePlayingRecordedFile, GetRecordingObj, } from 'audio-utilis';

// ...

const isRecording, setIsRecording = useState(false); const isPlaying, setIsPlaying = useState(false);

const handleStartRecs = () => { setIsRecording(true); StartRecording(); };

const handleStopRecs = () => { ... setIsRecording(false); StopRecording(); };

const cleanUpRecds = () => { ... CleanUpFiles(); };

const handlePlayAudio = async () => { return new Promise((resolve, reject) => { setIsPlaying(true); PlayRecordedFile() .then(flag => { console.log('in func ===> ', flag); setIsPlaying(!flag); resolve(flag); }) .catch(error => { reject(error); setIsPlaying(false); }); }); };

const handlePauseRecd = () => { setIsPlaying(false); PauseRecordedFile(); };

const getFile = () => { const recdFile = await GetRecordingObj(); console.log(recdFile); };

const cancelAudioPlayer = () => { StopWhilePlayingRecordedFile(); setIsPlaying(false) };

const resumeRecording = () => { ResumeRecordedFile(); setIsRecording(True) };

1.1.0

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago