Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed SDFileSystem_Copy_of_mbed_version I2S
Diff: NotchingDemo.cpp
- Branch:
- LargeFile_Tests
- Revision:
- 69:df10ee3ad523
- Parent:
- 68:55e26c5e837b
- Child:
- 70:2b144da2c3b8
--- 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
+ }
//=============================================================================================