diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2020-11-28 01:41:29 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2020-11-28 01:41:29 +0100 |
| commit | 88fde9b1b8adaaa290d4eb75c4434b58c2aac5d2 (patch) | |
| tree | 412dba3fcac26d43cb7abcb007b0bd3387e3e3d1 /mumd/src | |
| parent | 8b5546bef973652778a60280ab2ebbc528ad1e48 (diff) | |
| download | mum-88fde9b1b8adaaa290d4eb75c4434b58c2aac5d2.tar.gz | |
include_bytes instead of static filepaths
Diffstat (limited to 'mumd/src')
| -rw-r--r-- | mumd/src/audio.rs | 26 | ||||
| -rw-r--r-- | mumd/src/resources/channel_join.wav | bin | 0 -> 32002 bytes | |||
| -rw-r--r-- | mumd/src/resources/channel_leave.wav | bin | 0 -> 32002 bytes | |||
| -rw-r--r-- | mumd/src/resources/connect.wav | bin | 0 -> 32002 bytes | |||
| -rw-r--r-- | mumd/src/resources/deafen.wav | bin | 0 -> 32002 bytes | |||
| -rw-r--r-- | mumd/src/resources/disconnect.wav | bin | 0 -> 303364 bytes | |||
| -rw-r--r-- | mumd/src/resources/mute.wav | bin | 0 -> 32002 bytes | |||
| -rw-r--r-- | mumd/src/resources/undeafen.wav | bin | 0 -> 32002 bytes | |||
| -rw-r--r-- | mumd/src/resources/unmute.wav | bin | 0 -> 32002 bytes |
9 files changed, 13 insertions, 13 deletions
diff --git a/mumd/src/audio.rs b/mumd/src/audio.rs index d5617fc..d86cb84 100644 --- a/mumd/src/audio.rs +++ b/mumd/src/audio.rs @@ -17,32 +17,32 @@ use tokio::sync::{mpsc, watch}; //TODO? move to mumlib #[cfg(feature = "sound-effects")] -pub const EVENT_SOUNDS: &[(&str, NotificationEvents)] = &[ - ("resources/connect.wav", NotificationEvents::ServerConnect), +pub const EVENT_SOUNDS: &[(&'static [u8], NotificationEvents)] = &[ + (include_bytes!("resources/connect.wav"), NotificationEvents::ServerConnect), ( - "resources/disconnect.wav", + include_bytes!("resources/disconnect.wav"), NotificationEvents::ServerDisconnect, ), ( - "resources/channel_join.wav", + include_bytes!("resources/channel_join.wav"), NotificationEvents::UserConnected, ), ( - "resources/channel_leave.wav", + include_bytes!("resources/channel_leave.wav"), NotificationEvents::UserDisconnected, ), ( - "resources/channel_join.wav", + include_bytes!("resources/channel_join.wav"), NotificationEvents::UserJoinedChannel, ), ( - "resources/channel_leave.wav", + include_bytes!("resources/channel_leave.wav"), NotificationEvents::UserLeftChannel, ), - ("resources/mute.wav", NotificationEvents::Mute), - ("resources/unmute.wav", NotificationEvents::Unmute), - ("resources/deafen.wav", NotificationEvents::Deafen), - ("resources/undeafen.wav", NotificationEvents::Undeafen), + (include_bytes!("resources/mute.wav"), NotificationEvents::Mute), + (include_bytes!("resources/unmute.wav"), NotificationEvents::Unmute), + (include_bytes!("resources/deafen.wav"), NotificationEvents::Deafen), + (include_bytes!("resources/undeafen.wav"), NotificationEvents::Undeafen), ]; const SAMPLE_RATE: u32 = 48000; @@ -223,8 +223,8 @@ impl Audio { #[cfg(feature = "sound-effects")] let sounds = EVENT_SOUNDS .iter() - .map(|(path, event)| { - let reader = hound::WavReader::open(path).unwrap(); + .map(|(bytes, event)| { + let reader = hound::WavReader::new(*bytes).unwrap(); let spec = reader.spec(); let samples = match spec.sample_format { hound::SampleFormat::Float => reader diff --git a/mumd/src/resources/channel_join.wav b/mumd/src/resources/channel_join.wav Binary files differnew file mode 100644 index 0000000..82ee4d4 --- /dev/null +++ b/mumd/src/resources/channel_join.wav diff --git a/mumd/src/resources/channel_leave.wav b/mumd/src/resources/channel_leave.wav Binary files differnew file mode 100644 index 0000000..82ee4d4 --- /dev/null +++ b/mumd/src/resources/channel_leave.wav diff --git a/mumd/src/resources/connect.wav b/mumd/src/resources/connect.wav Binary files differnew file mode 100644 index 0000000..82ee4d4 --- /dev/null +++ b/mumd/src/resources/connect.wav diff --git a/mumd/src/resources/deafen.wav b/mumd/src/resources/deafen.wav Binary files differnew file mode 100644 index 0000000..82ee4d4 --- /dev/null +++ b/mumd/src/resources/deafen.wav diff --git a/mumd/src/resources/disconnect.wav b/mumd/src/resources/disconnect.wav Binary files differnew file mode 100644 index 0000000..fb2ca76 --- /dev/null +++ b/mumd/src/resources/disconnect.wav diff --git a/mumd/src/resources/mute.wav b/mumd/src/resources/mute.wav Binary files differnew file mode 100644 index 0000000..82ee4d4 --- /dev/null +++ b/mumd/src/resources/mute.wav diff --git a/mumd/src/resources/undeafen.wav b/mumd/src/resources/undeafen.wav Binary files differnew file mode 100644 index 0000000..82ee4d4 --- /dev/null +++ b/mumd/src/resources/undeafen.wav diff --git a/mumd/src/resources/unmute.wav b/mumd/src/resources/unmute.wav Binary files differnew file mode 100644 index 0000000..82ee4d4 --- /dev/null +++ b/mumd/src/resources/unmute.wav |
