old demo that i want to try in mbed studio

Dependencies:   mbed SDFileSystem_Copy_of_mbed_version I2S

Files at this revision

API Documentation at this revision

Comitter:
roryhand
Date:
Tue Oct 01 19:11:57 2019 +0000
Branch:
LargeFile_Tests
Parent:
75:8a71e269b890
Child:
77:e93c944ed30f
Commit message:
WIP - ISSUE STILL HERE. does not make any sense. An fread up in the problem code can take 3000-odd micro seconds to occur. however only takes between 7 and 22 us to occur in the regular "notch" section at the end.

Changed in this revision

NotchingDemo.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/NotchingDemo.cpp	Tue Oct 01 19:07:00 2019 +0000
+++ b/NotchingDemo.cpp	Tue Oct 01 19:11:57 2019 +0000
@@ -493,6 +493,7 @@
     Sound2 = ReadFileInfo(Sound2, wavfile2);
     Sound1 = ReadFileInfo(Sound1, wavfile1);
     NotchingSet.Notch = 1;
+    Positions.notch_position_indicators[1] = 44;
     fseek(wavfile1,Positions.notch_start_pts[1],SEEK_SET);
     fseek(wavfile2,Positions.notch_transitions_start_pts[1],SEEK_SET);
     printf("about to play wav file\n\r");
@@ -713,7 +714,15 @@
     }
     else
     {
+            
+            fseek(wavfile1,Positions.notch_position_indicators[1],SEEK_SET);
+            OperationsTimer.reset();
+            OperationsTimer.start();
             fread(Sound1.FileInfo.slice_buf,Sound1.FileInfo.FileFormat.block_align,1,wavfile1);
+            OperationsTimer.stop();
+            printf("It took %d useconds to perform fread operation.\n\r",OperationsTimer.read_us());
+            Positions.notch_position_indicators[1] = Positions.notch_position_indicators[1] + 2;//i.e. 2 bytes, per sample, for 2-byte (16-bit) data
+            
             Sound1.data_sptr=(short *)Sound1.FileInfo.slice_buf;     // 16 bit samples
         
     }