From f49598532dbef1f8fb0869be9ff49511db95aecd Mon Sep 17 00:00:00 2001 From: morkt Date: Sat, 25 Feb 2017 02:03:11 +0400 Subject: [PATCH] (WaveFormat.SetBPS): calculate AverageBytesPerSecond field. --- GameRes/Audio.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GameRes/Audio.cs b/GameRes/Audio.cs index 9424b5f2..00f59f9d 100644 --- a/GameRes/Audio.cs +++ b/GameRes/Audio.cs @@ -38,6 +38,11 @@ namespace GameRes public ushort BlockAlign; public ushort BitsPerSample; public ushort ExtraSize; + + public void SetBPS () + { + AverageBytesPerSecond = (uint)(SamplesPerSecond * Channels * BitsPerSample / 8); + } } public abstract class SoundInput : Stream