old demo that i want to try in mbed studio
Dependencies: mbed SDFileSystem_Copy_of_mbed_version I2S
Diff: NotchingDemo.cpp
- Revision:
- 31:0f8c3adf09c3
- Parent:
- 30:4a8e80b243c4
- Child:
- 32:6ee488c97dcc
--- a/NotchingDemo.cpp Sun May 26 20:41:05 2019 +0000 +++ b/NotchingDemo.cpp Sun May 26 20:58:26 2019 +0000 @@ -392,17 +392,8 @@ - timer_open.reset(); - timer_open.start(); - StartupWav = fopen("/sd/mydir/Startup.wav","rb"); - timer_open.reset(); - printf("It took %d useconds to open file\n\r",timer_open.read_us()); - //const char* folder2 = folder.c_str(); - timer_open.reset(); - timer_open.start(); - fclose(StartupWav); - timer_open.stop(); - printf("It took %d useconds to close file\n\r",timer_open.read_us()); + + string FileName; @@ -457,13 +448,31 @@ i2s.start(); sampletick.attach(&isr,1.0/sampling_freq); //1/16000 + + + timer_open.reset(); + timer_open.start(); StartupWav = fopen("/sd/mydir/Startup.wav","rb"); + timer_open.reset(); + printf("It took %d useconds to open file\n\r",timer_open.read_us()); + //const char* folder2 = folder.c_str(); + + + fseek(StartupWav,44,SEEK_SET); WavInfo_Startup = ReadFileInfo(WavInfo_Startup,StartupWav); + + + printf("about to play wav file\n\r"); Play_WaveFile(StartupWav,WavInfo_Startup); printf("finished playing Wav file\n\r"); + timer_open.reset(); + timer_open.start(); + fclose(StartupWav); + timer_open.stop(); + printf("It took %d useconds to close file\n\r",timer_open.read_us()); /************************************PLAY WAV FILE LOOP*******************/ //Play_WaveFileLoop(Sound, NotchingSet); /************************************END OF PLAY WAV FILE LOOP*************/