Skip to content

Commit 16acd5a

Browse files
committed
add sample WAV that uses Apple format #12
1 parent e919a2d commit 16acd5a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

data/03-02-03-01-02-01-19.wav

452 KB
Binary file not shown.

src/Spectrogram.Tests/Wav.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,20 @@ public void Test_WavFile_ReadHal2()
3838
plt.PlotSignal(R);
3939
plt.SaveFig("hal2.png");
4040
}
41+
42+
[Test]
43+
public void Test_WavFile_ReadDoor()
44+
{
45+
string wavFilePath = "../../../../../data/03-02-03-01-02-01-19.wav";
46+
(int sampleRate, double[] L) = WavFile.ReadMono(wavFilePath);
47+
Assert.AreEqual(48000, sampleRate);
48+
49+
double lengthSec = (double)L.Length / sampleRate;
50+
Assert.AreEqual(4.471, lengthSec, .5);
51+
52+
var plt = new Plot();
53+
plt.PlotSignal(L);
54+
plt.SaveFig("door.png");
55+
}
4156
}
4257
}

0 commit comments

Comments
 (0)