old demo that i want to try in mbed studio
Dependencies: mbed SDFileSystem_Copy_of_mbed_version I2S
Revision 83:5b61f67f3020, committed 2019-10-02
- Comitter:
- roryhand
- Date:
- Wed Oct 02 19:09:11 2019 +0000
- Branch:
- LargeFile_Tests
- Parent:
- 82:3694ee23a4d7
- Commit message:
- makes weird "pfft pfft pfft" noise when I dont use "Sound1.data_sptr" directly, but only indirectly
Changed in this revision
| NotchingDemo.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/NotchingDemo.cpp Wed Oct 02 18:37:28 2019 +0000
+++ b/NotchingDemo.cpp Wed Oct 02 19:09:11 2019 +0000
@@ -630,105 +630,15 @@
-/*
+
//Sound1=======================================================================================
+/*
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);
}
- if(BlockFlag == 1)
- {
- printf("we are inside if blockflag == 1\n\r");
- if(TransitionFlag) {
-
-
- 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;
-
-
-
- //NOTCH 2
-
- fseek(wavfile1,Positions.notch_position_indicators[NotchingSet.Notch],Positions.notch_position_indicators[NotchingSet.Notch]);
- fread(Sound3.FileInfo.slice_buf, Sound3.FileInfo.FileFormat.block_align,1,wavfile1);
- data_sptr3=(short *)Sound3.FileInfo.slice_buf;
- Positions.notch_position_indicators[NotchingSet.Notch] = Positions.notch_position_indicators[NotchingSet.Notch] + 2;
-
- //increment up the position indicator!
-
-
- if(NotchingSet.NotchDirection)
-
- {
- //printf("Reached if(NotchingSet.NotchDirection)\n\r");
-
- //N1 N2 Transition
- 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;
-
- } else {
- //N1 N2 Transition
- fseek(wavfile2,Positions.notch_transitions_position_indicators[NotchingSet.NotchTransDown],Positions.notch_position_indicators[NotchingSet.NotchTransDown]);
- 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;
-
- }
-
-
-
-
- NotchFadeOut.FadeOut();
-
- if(Positions.notch_transitions_position_indicators[NotchingSet.NotchTransUp] >= (Positions.notch_transitions_start_pts[NotchingSet.NotchTransUp+1] - NotchFadeIn.Length))
- {
- NotchFadeIn.FadeIn();
- if(Positions.notch_transitions_position_indicators[NotchingSet.NotchTransUp] >= Positions.notch_transitions_start_pts[NotchingSet.NotchTransUp+1])
- {
- *Sound1.data_sptr = *data_sptr3*NotchFadeIn.FadeCoeff;
- //TransitionFlag = 0;
- //fseek(wavfile1,Positions.notch_position_indicators[NotchingSet.Notch],Positions.notch_position_indicators[NotchingSet.Notch]);
-
- }
- else
- {
- *Sound1.data_sptr = *data_sptr1*NotchFadeOut.FadeCoeff + *data_sptr2 + *data_sptr3*NotchFadeIn.FadeCoeff;
- }
-
-
- }
-
-
- else
- {
- *Sound1.data_sptr = *data_sptr1*NotchFadeOut.FadeCoeff + *data_sptr2;
- //include a flag here, to hand over control. Going to get a bit complicated!!!
- }
-
-
-
-
-
-
- } else {
-
-
- fseek(wavfile1,Positions.notch_position_indicators[NotchingSet.Notch],Positions.notch_position_indicators[NotchingSet.Notch]);
- fread(Sound3.FileInfo.slice_buf, Sound3.FileInfo.FileFormat.block_align,1,wavfile1);
- data_sptr1=(short *)Sound3.FileInfo.slice_buf;
- Positions.notch_position_indicators[NotchingSet.Notch] = Positions.notch_position_indicators[NotchingSet.Notch] + 2;
-
- }
- }
- else
-
- {
-
+
if(TransitionFlag) {
@@ -802,20 +712,21 @@
+*/
+
+ // } else {
- } else {
-
-*/
- fseek(wavfile1,Positions.notch_position_indicators[NotchingSet.Notch],Positions.notch_position_indicators[NotchingSet.Notch]);
+ //fseek(wavfile1,Positions.notch_position_indicators[NotchingSet.Notch],Positions.notch_position_indicators[NotchingSet.Notch]);
+
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] = Positions.notch_position_indicators[NotchingSet.Notch] + 2;
+ *Sound1.data_sptr = *data_sptr1;
+ //Positions.notch_position_indicators[NotchingSet.Notch] = Positions.notch_position_indicators[NotchingSet.Notch] + 2;
// }
-
- //}
+
//=============================================================================================