File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using NUnit . Framework ;
22using System ;
33using System . Collections . Generic ;
4+ using System . Drawing ;
45using System . Text ;
56
67namespace 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 ) ;
You can’t perform that action at this time.
0 commit comments