Skip to content

Commit c6b40b0

Browse files
committed
update comments in old WavFile module
1 parent 14f829f commit c6b40b0

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/Spectrogram/WavFile.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
// Simple WAV file reader by Scott Harden released under a MIT license
2-
// Format here is based on http://soundfile.sapp.org/doc/WaveFormat/
3-
4-
using System;
1+
using System;
52
using System.Diagnostics;
63
using System.IO;
74

@@ -31,10 +28,10 @@ public static (int sampleRate, double[] L, double[] R) ReadStereo(string filePat
3128
{
3229
// The first chunk is RIFF section
3330
// Length should be the number of bytes in the file minus 4
34-
var riffChunk = ChunkInfo(br, 0);
35-
Console.WriteLine($"First chunk '{riffChunk.id}' indicates {riffChunk.length:N0} bytes");
36-
if (riffChunk.id != "RIFF")
37-
throw new InvalidOperationException($"Unsupported WAV format (first chunk ID was '{riffChunk.id}', not 'RIFF')");
31+
var (id, length) = ChunkInfo(br, 0);
32+
Console.WriteLine($"First chunk '{id}' indicates {length:N0} bytes");
33+
if (id != "RIFF")
34+
throw new InvalidOperationException($"Unsupported WAV format (first chunk ID was '{id}', not 'RIFF')");
3835

3936
// The second chunk is FORMAT section
4037
var fmtChunk = ChunkInfo(br, 12);

0 commit comments

Comments
 (0)