Define audio channels with type-safe names and initial volumes. Mirrors defineCollisionLayers pattern.
defineCollisionLayers
Object mapping channel names to their configuration
Frozen channel configuration with inferred channel name union
const channels = defineAudioChannels({ sfx: { volume: 1 }, music: { volume: 0.7 }, ui: { volume: 0.8 },});type Ch = ChannelsOf<typeof channels>; // 'sfx' | 'music' | 'ui' Copy
const channels = defineAudioChannels({ sfx: { volume: 1 }, music: { volume: 0.7 }, ui: { volume: 0.8 },});type Ch = ChannelsOf<typeof channels>; // 'sfx' | 'music' | 'ui'
Define audio channels with type-safe names and initial volumes. Mirrors
defineCollisionLayerspattern.