1. Core Hooks
  2. useThrelteAudio

Core Hooks

useThrelteAudio

This hook lets you consume the audio context. Although it can be useful, this is mostly used internally.

Import

Source

GitHub View Source Code
INFO

This hook needs context. Use only in a child component to <Canvas>.


Types

const {
  audioListeners, // Map<string, AudioListener>
  getAudioListener, // (id?: string) => AudioListener | undefined
  addAudioListener, // (listener: AudioListener, id?: string) => void
  removeAudioListener // (id?: string) => void
} = useThrelteAudio()