old demo that i want to try in mbed studio
Dependencies: mbed SDFileSystem_Copy_of_mbed_version I2S
Revision 69:df10ee3ad523, committed 2019-09-29
- Comitter:
- roryhand
- Date:
- Sun Sep 29 21:07:27 2019 +0000
- Branch:
- LargeFile_Tests
- Parent:
- 68:55e26c5e837b
- Child:
- 70:2b144da2c3b8
- Commit message:
- WIP - have added some of the logic required into the Play_WaveFileLoop Fnc.
Changed in this revision
| NotchingDemo.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/NotchingDemo.cpp Sun Sep 29 20:54:34 2019 +0000
+++ b/NotchingDemo.cpp Sun Sep 29 21:07:27 2019 +0000
@@ -307,6 +307,9 @@
}
}
+char *slice_buf1;
+char *slice_buf2;
+char *slice_buf3;
int OneOff = 0;
int notch_flag = 0;
@@ -592,13 +595,38 @@
//Sound1=======================================================================================
- if( slice1 == (Positions.notch_start_pts[Notching.Notch + 1]) ) {
- slice1 = Positions.notch_start_pts[Notching.Notch];
- fseek(wavfile1,Positions.notch_start_pts[Notching.Notch],SEEK_SET);
+ if( slice1 == (Positions.notch_start_pts[NotchingSet.Notch + 1]) ) {
+ slice1 = Positions.notch_start_pts[NotchingSet.Notch];
+ fseek(wavfile1,Positions.notch_start_pts[NotchingSet.Notch],SEEK_SET);
}
- fread(Sound1.FileInfo.slice_buf,Sound1.FileInfo.FileFormat.block_align,1,wavfile1);
- Sound1.data_sptr=(short *)Sound1.FileInfo.slice_buf; // 16 bit samples
+ if(NotchingSet.Notch > 1) {
+
+ fseek(wavfile1,Positions.notch_position_indicators[NotchingSet.Notch],SEEK_SET);
+ fread(slice_buf1, Sound1.FileInfo.FileFormat.block_align,1,wavfile1);
+
+ fseek(wavfile1,Positions.notch_position_indicators[NotchingSet.Notch - 1],SEEK_SET);
+ fread(slice_buf2, Sound1.FileInfo.FileFormat.block_align,1,wavfile1);
+
+ if(NotchingSet.NotchDirection)
+
+ {
+
+ fseek(wavfile1,Positions.notch_position_indicators[NotchingSet.NotchTransUp],SEEK_SET);
+ fread(slice_buf3, Sound1.FileInfo.FileFormat.block_align,1,wavfile1);
+
+
+ } else {
+
+ fseek(wavfile1,Positions.notch_position_indicators[NotchingSet.NotchTransDown],SEEK_SET);
+ fread(slice_buf3, Sound1.FileInfo.FileFormat.block_align,1,wavfile1);
+ }
+
+ } else {
+
+ fread(Sound1.FileInfo.slice_buf,Sound1.FileInfo.FileFormat.block_align,1,wavfile1);
+ Sound1.data_sptr=(short *)Sound1.FileInfo.slice_buf; // 16 bit samples
+ }
//=============================================================================================