old demo that i want to try in mbed studio
Dependencies: mbed SDFileSystem_Copy_of_mbed_version I2S
Revision 33:a75f0a30fbdc, committed 2019-05-26
- Comitter:
- roryhand
- Date:
- Sun May 26 22:09:28 2019 +0000
- Parent:
- 32:6ee488c97dcc
- Child:
- 34:26118c8f2e48
- Commit message:
- WIP - testing to see if we can switch files inside the main play loop.
Changed in this revision
| NotchingDemo.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/NotchingDemo.cpp Sun May 26 21:29:41 2019 +0000
+++ b/NotchingDemo.cpp Sun May 26 22:09:28 2019 +0000
@@ -246,6 +246,7 @@
short *data_sptr_startup = 0;
FILE *StartupWav;
FILE *N3Wav;
+int temp = 0;
void flip()
{
led2 = !led2;
@@ -293,7 +294,12 @@
void FileSwitch_isr()
{
FileSwitchFlag = 1;
-
+ temp = 1;
+ /*FILE* testwav = fopen("/sd/mydir/SoundDecoder_second/05.wav","rb");
+ if(N3Wav == NULL) {
+ printf("Cannot Open testwav\n\r");
+ }
+ */
fseek(N3Wav,44,SEEK_SET);
// fclose(StartupWav);
}
@@ -659,6 +665,15 @@
if(FileSwitchFlag == 1) {
fread(WavInfo_N3.slice_buf,WavInfo_N3.FileFormat.block_align,1,N3Wav);
data_sptr=(short*)WavInfo_N3.slice_buf;
+ if(temp == 1) {
+ FILE* testwav = fopen("/sd/mydir/SoundDecoder_second/05.wav","rb");
+ if(N3Wav == NULL) {
+ printf("Cannot Open testwav\n\r");
+ }
+ fclose(StartupWav);
+ temp = 0;
+ }
+
} else {
fread(FileInfo.slice_buf,FileInfo.FileFormat.block_align,1,my_wav);
data_sptr=(short *)FileInfo.slice_buf; // 16 bit samples