Visit the Documentation of the upcoming Threlte 6.
  1. @threlte/core
  2. useThrelteAudio

@threlte/core

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

Package

NPM View Package
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()