mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-13 22:12:22 -06:00
chore: lower audio tracing to trace level
This commit is contained in:
@@ -24,6 +24,7 @@ impl Audio {
|
|||||||
let format = DEFAULT_FORMAT;
|
let format = DEFAULT_FORMAT;
|
||||||
let channels = 4;
|
let channels = 4;
|
||||||
let chunk_size = 128;
|
let chunk_size = 128;
|
||||||
|
|
||||||
mixer::open_audio(frequency, format, 1, chunk_size).expect("Failed to open audio");
|
mixer::open_audio(frequency, format, 1, chunk_size).expect("Failed to open audio");
|
||||||
mixer::allocate_channels(channels);
|
mixer::allocate_channels(channels);
|
||||||
|
|
||||||
@@ -54,13 +55,11 @@ impl Audio {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Plays the "eat" sound effect.
|
/// Plays the "eat" sound effect.
|
||||||
///
|
|
||||||
/// This function also logs the time since the last sound effect was played.
|
|
||||||
pub fn eat(&mut self) {
|
pub fn eat(&mut self) {
|
||||||
if let Some(chunk) = self.sounds.get(self.next_sound_index) {
|
if let Some(chunk) = self.sounds.get(self.next_sound_index) {
|
||||||
match mixer::Channel(0).play(chunk, 0) {
|
match mixer::Channel(0).play(chunk, 0) {
|
||||||
Ok(channel) => {
|
Ok(channel) => {
|
||||||
tracing::info!("Playing sound #{} on channel {:?}", self.next_sound_index + 1, channel);
|
tracing::trace!("Playing sound #{} on channel {:?}", self.next_sound_index + 1, channel);
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
tracing::warn!("Could not play sound #{}: {}", self.next_sound_index + 1, e);
|
tracing::warn!("Could not play sound #{}: {}", self.next_sound_index + 1, e);
|
||||||
|
|||||||
Reference in New Issue
Block a user