old demo that i want to try in mbed studio
Dependencies: mbed SDFileSystem_Copy_of_mbed_version I2S
Diff: NotchingDemo.cpp
- Revision:
- 40:ba34990514fa
- Parent:
- 39:69d5a5dd9163
- Child:
- 41:5dca752e6c40
--- a/NotchingDemo.cpp Mon Jun 17 20:54:09 2019 +0000 +++ b/NotchingDemo.cpp Mon Jun 17 21:42:02 2019 +0000 @@ -388,12 +388,15 @@ int main() { //std::vector<classSoundFile> v = {Sound1, Sound2, Sound3, Sound4}; + classSoundFile Sound1,Sound2,Sound3,Sound4,Sound5; Sound1.file_location = '1'; Sound2.file_location = '2'; Sound3.file_location = '3'; Sound4.file_location = '4'; Sound5.file_location = '5'; + + std::vector<classSoundFile> v; v.push_back(Sound1); @@ -401,16 +404,21 @@ v.push_back(Sound3); v.push_back(Sound4); v.push_back(Sound5); - for(int c = 1; c<6; c++) { - printf("This is Sound No.: %s\n\r",v.at(c)); + for(int c = 0; c<5; c++) { + printf("This is Sound No.: %s\n\r",v.at(c).file_location); } v.erase(v.begin() + 1); - for(int c = 1; c<6; c++) { - printf("This is Sound No.: %s\n\r",v.at(c)); + v.at(1); + classSoundFile RandomSound; + RandomSound.file_location = 'placeholder'; + v.push_back(RandomSound); + for(int c = 0; c<5; c++) { + printf("This is Sound No.: %s\n\r",v.at(c).file_location); } + /* int ArrayOfSounds[6]; ArrayOfSounds[1] = classSoundFile Sound1; @@ -451,7 +459,8 @@ classSoundFile Sound[22]; string file_names[22]; const char* FileName; - for(int aaa = 0; aaa < 20; aaa ++) { + /* + for(int aaa = 0; aaa < 20; aaa ++) { a = aaa+1; sprintf(buf, "%d", a); Sound[aaa].file_location = RootFolder + "0" + buf + ".wav"; @@ -461,12 +470,15 @@ printf("Cannot Open Sound[%d].FileInfo.WavFile\n\r",aaa); } + */ + /* printf("FileName: %s\n\r",Sound[aaa].file_location); fclose(Sound[aaa].FileInfo.WavFile); free(Sound[aaa].FileInfo.WavFile); + */ //wait(1); - } + // } /* string RootFolder = "sd/mydir/SoundDecoder_second/";