Skip to main content

useAudio

useAudio is a hook that provides access to audio playing functionality.

const { play } = useAudio();

Reference

play function

Play an audio file once.

Parameters

  • sound: The path to the sound effect that should be played.

Returns

Nothing