aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src/audio/sound_effects.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-06-19 16:32:30 +0200
committerGustav Sörnäs <gustav@sornas.net>2021-06-19 16:32:30 +0200
commit6b9d837c447c520106b0d888103ad77af93046f4 (patch)
tree8c91c791c444634f5dad420bcb404fb3084dc7e5 /mumd/src/audio/sound_effects.rs
parent3fdb06f677163f856a0233676440606b8f7bf6bd (diff)
downloadmum-6b9d837c447c520106b0d888103ad77af93046f4.tar.gz
documentation
Diffstat (limited to 'mumd/src/audio/sound_effects.rs')
-rw-r--r--mumd/src/audio/sound_effects.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/mumd/src/audio/sound_effects.rs b/mumd/src/audio/sound_effects.rs
index ae96fa3..49cb009 100644
--- a/mumd/src/audio/sound_effects.rs
+++ b/mumd/src/audio/sound_effects.rs
@@ -74,6 +74,8 @@ impl TryFrom<&str> for NotificationEvents {
}
}
+/// Loads files into an "event -> data"-map, with support for overriding
+/// specific events with another sound file.
pub fn load_sound_effects(overrides: &[SoundEffect], num_channels: usize) -> HashMap<NotificationEvents, Vec<f32>> {
let overrides: HashMap<_, _> = overrides
.iter()
@@ -164,6 +166,7 @@ fn unpack_ogg(data: Cow<[u8]>) -> (Vec<f32>, AudioSpec) {
}
#[cfg(not(feature = "ogg"))]
+/// Fallback to default sound effect since ogg is disabled.
fn unpack_ogg(_: Cow<[u8]>) -> (Vec<f32>, AudioSpec) {
warn!("Can't open .ogg without the ogg-feature enabled.");
unpack_wav(get_default_sfx())