Rory Hand / Mbed 2 deprecated NotchingDemo

Dependencies:   mbed SDFileSystem_Copy_of_mbed_version I2S

Branch:
LargeFile_Tests
Revision:
78:69a0c7a5fbdf
Parent:
77:e93c944ed30f
Child:
79:00cc7799407f
Child:
84:0a259e261532
--- a/NotchingDemo.cpp	Tue Oct 01 20:05:29 2019 +0000
+++ b/NotchingDemo.cpp	Tue Oct 01 20:14:26 2019 +0000
@@ -647,21 +647,27 @@
             OperationsTimer.reset();
             OperationsTimer.start();
             */
+            fseek(wavfile1,Positions.notch_position_indicators[NotchingSet.Notch-1],Positions.notch_position_indicators[NotchingSet.Notch-1]);
             fread(Sound1.FileInfo.slice_buf, Sound1.FileInfo.FileFormat.block_align,1,wavfile1);
+            data_sptr1=(short *)Sound1.FileInfo.slice_buf;
+            Positions.notch_position_indicators[NotchingSet.Notch-1] = Positions.notch_position_indicators[NotchingSet.Notch-1] + 2;
             
+            fseek(wavfile2,Positions.notch_transitions_position_indicators[NotchingSet.NotchTransUp],Positions.notch_transitions_position_indicators[NotchingSet.NotchTransUp]);
+            fread(Sound2.FileInfo.slice_buf, Sound2.FileInfo.FileFormat.block_align,1,wavfile2);
+            data_sptr2=(short *)Sound2.FileInfo.slice_buf; 
+            Positions.notch_transitions_position_indicators[NotchingSet.NotchTransUp] = Positions.notch_transitions_position_indicators[NotchingSet.NotchTransUp] + 2;
+
+           
             /*
             OperationsTimer.stop();
             printf("It took %d useconds to perform fread operation.\n\r",OperationsTimer.read_us());
             */
             //printf("We have now read in 2 bytes of data (i.e. 1 sample)\n\r");
-            data_sptr1=(short *)Sound1.FileInfo.slice_buf;
+
             //printf("We have now cast this data to a short data type\n\r");
-            Positions.notch_position_indicators[NotchingSet.Notch-1] = Positions.notch_position_indicators[NotchingSet.Notch-1] + 2;
             
             
-            fseek(wavfile2,Positions.notch_transitions_position_indicators[NotchingSet.NotchTransUp],Positions.notch_transitions_position_indicators[NotchingSet.NotchTransUp]);
-            fread(Sound1.FileInfo.slice_buf, Sound1.FileInfo.FileFormat.block_align,1,wavfile2);
-            data_sptr2=(short *)Sound2.FileInfo.slice_buf; 
+
             
             
             //printf("We have incremented up the Positions.notch_position_indicator");
@@ -722,8 +728,11 @@
             */
             //else
             //{
-                //*Sound1.data_sptr = *data_sptr1*NotchFadeOut.FadeCoeff + *data_sptr2;
-                *Sound1.data_sptr = *data_sptr1;// + *data_sptr2;
+                *Sound1.data_sptr = *data_sptr1*NotchFadeOut.FadeCoeff + *data_sptr2;
+                //*Sound1.data_sptr = *data_sptr1;// + *data_sptr2;
+                 
+                 
+             
                 //include a flag here, to hand over control.  Going to get a bit complicated!!!    
             //}