Skip to content

Commit d064ea5

Browse files
committed
add scaling to test system WAV file reader
1 parent 2284099 commit d064ea5

16 files changed

+23
-66
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ spec.SaveImage("spectrogram-song.jpg", intensity: 5, dB: true);
9191

9292
Notice the optional conversion to Decibels while saving the image.
9393

94-
![](dev/spectrogram-song.jpg)
94+
![](dev/graphics/spectrogram-song.png)
9595

9696
If you [listen to the audio track](https://www.youtube.com/watch?v=Mza-xqk770k) while closely inspecting the spectrogram you can identify individual piano notes and chords, and may be surprised by the interesting patterns that emerge around trills and glissandos.
9797

dev/graphics/hal-spectrogram.png

5.02 KB
Loading

dev/graphics/hal.png

7.84 KB
Loading

dev/graphics/halMel-LinearCropped.png

10.4 KB
Loading

dev/graphics/halMel-MelScale.png

4.45 KB
Loading

dev/graphics/spectrogram-song.png

2.06 MB
Loading

dev/sff/hal.sff

0 Bytes
Binary file not shown.

dev/sff/halMel.png

-425 Bytes
Loading

dev/sff/halMel.sff

0 Bytes
Binary file not shown.

src/Spectrogram.Tests/ColormapExamples.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ColormapExamples
99
[Test]
1010
public void Test_Make_CommonColormaps()
1111
{
12-
(double[] audio, int sampleRate) = TestTools.ReadWavWithNAudio("../../../../../data/cant-do-that-44100.wav");
12+
(double[] audio, int sampleRate) = WavFile.ReadWavWithNAudio("../../../../../data/cant-do-that-44100.wav");
1313
int fftSize = 1 << 12;
1414
var spec = new Spectrogram(sampleRate, fftSize, stepSize: 700, maxFreq: 2000);
1515
spec.SetWindow(FftSharp.Window.Hanning(fftSize / 3)); // sharper window than typical
@@ -22,7 +22,7 @@ public void Test_Make_CommonColormaps()
2222
foreach (var cmap in Colormap.GetColormaps())
2323
{
2424
spec.SetColormap(cmap);
25-
spec.SaveImage($"../../../../../dev/graphics/hal-{cmap.Name}.png", intensity: 16_000);
25+
spec.SaveImage($"../../../../../dev/graphics/hal-{cmap.Name}.png");
2626
Debug.WriteLine($"![](dev/graphics/hal-{cmap.Name}.png)");
2727
}
2828
}

0 commit comments

Comments
 (0)