diff --git a/dvmconsole/AudioConverter.cs b/dvmconsole/AudioConverter.cs index 6e8686d..dea8d4c 100644 --- a/dvmconsole/AudioConverter.cs +++ b/dvmconsole/AudioConverter.cs @@ -28,20 +28,20 @@ namespace dvmconsole /// /// /// - public static List SplitToChunks(byte[] audioData, int OgLength = OriginalPcmLength, int ExepcetedLength = ExpectedPcmLength) + public static List SplitToChunks(byte[] audioData, int origLen = OriginalPcmLength, int expectedLength = ExpectedPcmLength) { List chunks = new List(); - if (audioData.Length != OgLength) + if (audioData.Length != origLen) { - Trace.WriteLine($"Invalid PCM length: {audioData.Length}, expected: {OgLength}"); + Trace.WriteLine($"Invalid PCM length: {audioData.Length}, expected: {origLen}"); return chunks; } - for (int offset = 0; offset < OgLength; offset += ExepcetedLength) + for (int offset = 0; offset < origLen; offset += expectedLength) { byte[] chunk = new byte[ExpectedPcmLength]; - Buffer.BlockCopy(audioData, offset, chunk, 0, ExepcetedLength); + Buffer.BlockCopy(audioData, offset, chunk, 0, expectedLength); chunks.Add(chunk); } @@ -53,21 +53,21 @@ namespace dvmconsole /// /// /// - public static byte[] CombineChunks(List chunks, int OgLength = OriginalPcmLength, int ExepcetedLength = ExpectedPcmLength) + public static byte[] CombineChunks(List chunks, int origLen = OriginalPcmLength, int expectedLength = ExpectedPcmLength) { - if (chunks.Count * ExepcetedLength != OgLength) + if (chunks.Count * expectedLength != origLen) { - Trace.WriteLine($"Invalid number of chunks: {chunks.Count}, expected total length: {OgLength}"); + Trace.WriteLine($"Invalid number of chunks: {chunks.Count}, expected total length: {origLen}"); return null; } - byte[] combined = new byte[OgLength]; + byte[] combined = new byte[origLen]; int offset = 0; foreach (var chunk in chunks) { - Buffer.BlockCopy(chunk, 0, combined, offset, ExepcetedLength); - offset += ExepcetedLength; + Buffer.BlockCopy(chunk, 0, combined, offset, expectedLength); + offset += expectedLength; } return combined; @@ -90,5 +90,5 @@ namespace dvmconsole } return floats; } - } -} + } // public static class AudioConverter +} // namespace dvmconsole