From c08abee0770df3d99cdd3d1f8d1bcb4e61e1cbc6 Mon Sep 17 00:00:00 2001 From: CybertronicToon Date: Sat, 18 Feb 2017 01:30:45 -0600 Subject: [PATCH] Adds proper metal and dig sounds Adds pitch adjustment for metal sounds and dig sounds. --- ClassicalSharp/Audio/AudioPlayer.Sounds.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ClassicalSharp/Audio/AudioPlayer.Sounds.cs b/ClassicalSharp/Audio/AudioPlayer.Sounds.cs index 5335740a3..fe5e8a113 100644 --- a/ClassicalSharp/Audio/AudioPlayer.Sounds.cs +++ b/ClassicalSharp/Audio/AudioPlayer.Sounds.cs @@ -51,11 +51,17 @@ namespace ClassicalSharp.Audio { if (snd == null) return; chunk.Channels = snd.Channels; - chunk.SampleRate = snd.SampleRate; chunk.BitsPerSample = snd.BitsPerSample; chunk.BytesOffset = 0; chunk.BytesUsed = snd.Data.Length; chunk.Data = snd.Data; + if (board == digBoard) { + if (type == SoundType.Metal) chunk.SampleRate = (snd.SampleRate * 6) / 5; + else chunk.SampleRate = (snd.SampleRate * 4) / 5; + } else { + if (type == SoundType.Metal) chunk.SampleRate = (snd.SampleRate * 7) / 5; + else chunk.SampleRate = snd.SampleRate; + } if (snd.Channels == 1) { PlayCurrentSound(monoOutputs); @@ -144,4 +150,4 @@ namespace ClassicalSharp.Audio { outputs = null; } } -} \ No newline at end of file +}