Skip to content

Commit b6dfa10

Browse files
committed
dont limit frequency in mel SFF test
1 parent 1ae9641 commit b6dfa10

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Spectrogram.Tests/FileFormat.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using NUnit.Framework;
22
using System;
33
using System.Collections.Generic;
4+
using System.Drawing;
45
using System.Text;
56

67
namespace Spectrogram.Tests
@@ -32,10 +33,13 @@ public void Test_SFF_Mel()
3233
{
3334
(int sampleRate, double[] audio) = WavFile.ReadMono("../../../../../data/cant-do-that-44100.wav");
3435
int fftSize = 1 << 12;
35-
var spec = new Spectrogram(sampleRate, fftSize, stepSize: 700, maxFreq: 2000);
36+
var spec = new Spectrogram(sampleRate, fftSize, stepSize: 700);
3637
spec.SetWindow(FftSharp.Window.Hanning(fftSize / 3)); // sharper window than typical
3738
spec.Add(audio);
38-
spec.SaveData("../../../../../dev/sff/halMel.sff", melBinCount: 50);
39+
40+
Bitmap bmp = spec.GetBitmapMel(250, 3, true);
41+
bmp.Save("../../../../../dev/sff/halMel.png", System.Drawing.Imaging.ImageFormat.Png);
42+
spec.SaveData("../../../../../dev/sff/halMel.sff", melBinCount: 250);
3943

4044
var spec2 = new SFF("../../../../../dev/sff/halMel.sff");
4145
Assert.AreEqual(spec.SampleRate, spec2.SampleRate);

0 commit comments

Comments
 (0)