npm install --save use-simple-audio
const { play, pause, stop } = useSimpleAudio(src, loop)
src
: audio file pathloop
: (optional) flag for loop playback
play
: play audio functionpause
: pause audio functionstop
: stop audio function
MIT © ossan-engineer
This hook is created using create-react-hook.