File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ public void Test_SFF_Linear2()
6262
6363 // save the SFF
6464 int fftSize = 1 << 12 ;
65- var spec = new Spectrogram ( sampleRate , fftSize , stepSize : 700 , maxFreq : 2000 ) ;
66- spec . SetWindow ( FftSharp . Window . Hanning ( fftSize / 3 ) ) ; // sharper window than typical
65+ var spec = new Spectrogram ( sampleRate , fftSize , stepSize : 300 , maxFreq : 2000 ) ;
6766 spec . Add ( audio ) ;
6867 spec . SaveData ( "testDoor.sff" ) ;
6968
@@ -77,5 +76,19 @@ public void Test_SFF_Linear2()
7776 Assert . AreEqual ( spec . Height , spec2 . Height ) ;
7877 Assert . AreEqual ( spec . OffsetHz , spec2 . OffsetHz ) ;
7978 }
79+
80+ [ Test ]
81+ public void Test_SFF_LinearBigMaxFreq ( )
82+ {
83+ // test creating SFF file from 16-bit 48kHz mono WAV file
84+
85+ ( int sampleRate , double [ ] audio ) = WavFile . ReadMono ( "../../../../../data/03-02-03-01-02-01-19.wav" ) ;
86+ Assert . AreEqual ( 48000 , sampleRate ) ;
87+
88+ int fftSize = 1 << 12 ;
89+ var spec = new Spectrogram ( sampleRate , fftSize , stepSize : 300 , maxFreq : 7999 ) ;
90+ spec . Add ( audio ) ;
91+ spec . SaveData ( "testDoorBig.sff" ) ;
92+ }
8093 }
8194}
You can’t perform that action at this time.
0 commit comments