#[repr(u8)]pub enum AudioChannel {
Music = 0,
SFX = 1,
Voice = 2,
Ambience = 3,
UI = 4,
Custom(u8),
}Expand description
Audio channel enumeration for audio mixing and grouping.
Channels allow you to group audio sources together for volume control, filtering, and organization. Each audio source belongs to one channel.
§Built-in Channels
- Music: Background music tracks (typically looped)
- SFX: Sound effects (footsteps, impacts, UI clicks)
- Voice: Voice-overs, dialogue, speech
- Ambience: Ambient environment sounds (wind, rain, room tone)
- UI: User interface sounds (button clicks, menu navigation)
- Custom: User-defined channels (bits 5-31)
§Examples
use goud_engine::ecs::components::AudioChannel;
let music = AudioChannel::Music;
let sfx = AudioChannel::SFX;
let custom = AudioChannel::Custom(8); // Custom channel ID 8
assert_eq!(music.id(), 0);
assert_eq!(sfx.id(), 1);
assert_eq!(custom.id(), 8);Variants§
Music = 0
Background music tracks (channel ID: 0)
SFX = 1
Sound effects (channel ID: 1)
Voice = 2
Voice-overs and dialogue (channel ID: 2)
Ambience = 3
Ambient environment sounds (channel ID: 3)
UI = 4
User interface sounds (channel ID: 4)
Custom(u8)
Custom channel (ID 5-31)
Implementations§
Trait Implementations§
Source§impl Clone for AudioChannel
impl Clone for AudioChannel
Source§fn clone(&self) -> AudioChannel
fn clone(&self) -> AudioChannel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AudioChannel
impl Debug for AudioChannel
Source§impl Default for AudioChannel
impl Default for AudioChannel
Source§fn default() -> AudioChannel
fn default() -> AudioChannel
Returns AudioChannel::SFX as the default.
Source§impl<'de> Deserialize<'de> for AudioChannel
impl<'de> Deserialize<'de> for AudioChannel
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AudioChannel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AudioChannel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for AudioChannel
impl Display for AudioChannel
Source§impl Hash for AudioChannel
impl Hash for AudioChannel
Source§impl PartialEq for AudioChannel
impl PartialEq for AudioChannel
Source§impl Serialize for AudioChannel
impl Serialize for AudioChannel
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for AudioChannel
impl Eq for AudioChannel
impl StructuralPartialEq for AudioChannel
Auto Trait Implementations§
impl Freeze for AudioChannel
impl RefUnwindSafe for AudioChannel
impl Send for AudioChannel
impl Sync for AudioChannel
impl Unpin for AudioChannel
impl UnsafeUnpin for AudioChannel
impl UnwindSafe for AudioChannel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().