diff --git a/SimpleGame/media/metronome.wav b/SimpleGame/media/metronome.wav new file mode 100644 index 0000000..7730dc1 Binary files /dev/null and b/SimpleGame/media/metronome.wav differ diff --git a/SimpleGame/media/percussions/drums1.wav b/SimpleGame/media/percussions/drums1.wav new file mode 100644 index 0000000..8cbdba9 Binary files /dev/null and b/SimpleGame/media/percussions/drums1.wav differ diff --git a/SimpleGame/media/percussions/drums2.wav b/SimpleGame/media/percussions/drums2.wav new file mode 100644 index 0000000..e921428 Binary files /dev/null and b/SimpleGame/media/percussions/drums2.wav differ diff --git a/SimpleGame/media/percussions/drums3.wav b/SimpleGame/media/percussions/drums3.wav new file mode 100644 index 0000000..35c9391 Binary files /dev/null and b/SimpleGame/media/percussions/drums3.wav differ diff --git a/SimpleGame/src/Source/AudioEmitter.cpp b/SimpleGame/src/Source/AudioEmitter.cpp index 82d79f6..fe805f6 100644 --- a/SimpleGame/src/Source/AudioEmitter.cpp +++ b/SimpleGame/src/Source/AudioEmitter.cpp @@ -25,8 +25,7 @@ AudioEmitter::AudioEmitter() { system.reset(rawSystem); ERRCHECK(system->init(512, FMOD_INIT_NORMAL, nullptr)); - std::vector rawChords(14); - printf("coucou\n"); + std::vector rawChords(7); ERRCHECK(system->createSound("media/chords/variation1/C.mp3", FMOD_LOOP_OFF, nullptr, &rawChords[0])); ERRCHECK(system->createSound("media/chords/variation1/D.mp3", FMOD_LOOP_OFF, nullptr, @@ -41,21 +40,22 @@ AudioEmitter::AudioEmitter() { &rawChords[5])); ERRCHECK(system->createSound("media/chords/variation1/B.mp3", FMOD_LOOP_OFF, nullptr, &rawChords[6])); + std::vector rawChords2(7); ERRCHECK(system->createSound("media/chords/variation2/C.mp3", FMOD_LOOP_OFF, nullptr, - &rawChords[7])); + &rawChords2[0])); ERRCHECK(system->createSound("media/chords/variation2/D.mp3", FMOD_LOOP_OFF, nullptr, - &rawChords[8])); + &rawChords2[1])); ERRCHECK(system->createSound("media/chords/variation2/E.mp3", FMOD_LOOP_OFF, nullptr, - &rawChords[9])); + &rawChords2[2])); ERRCHECK(system->createSound("media/chords/variation2/F.mp3", FMOD_LOOP_OFF, nullptr, - &rawChords[10])); + &rawChords2[3])); ERRCHECK(system->createSound("media/chords/variation2/G.mp3", FMOD_LOOP_OFF, nullptr, - &rawChords[11])); + &rawChords2[4])); ERRCHECK(system->createSound("media/chords/variation2/A.mp3", FMOD_LOOP_OFF, nullptr, - &rawChords[12])); + &rawChords2[5])); ERRCHECK(system->createSound("media/chords/variation2/B.mp3", FMOD_LOOP_OFF, nullptr, - &rawChords[13])); - for (int i = 0; i < 14; i += 1) { + &rawChords2[6])); + for (int i = 0; i < 7; i += 1) { chords.push_back(std::unique_ptr(rawChords[i])); } @@ -198,7 +198,7 @@ AudioEmitter::AudioEmitter() { } FMOD::Sound *metronome_Sound; - ERRCHECK(system->createSound("media/notes/A1.mp3", FMOD_DEFAULT, nullptr, + ERRCHECK(system->createSound("media/percussions/drums1.wav", FMOD_DEFAULT, nullptr, &metronome_Sound)); ERRCHECK(system->playSound(metronome_Sound, nullptr, true, &timer)); ERRCHECK(timer->setVolume(0)); @@ -311,7 +311,6 @@ std::vector> AudioEmitter::generateMusic() { ERRCHECK(system->playSound(notes[index_note].get(), nullptr, true, &channelNote)); float note_start = (i + time / 8.f) * beatDuration; - printf("note start %f \n", note_start); unsigned long long delayNote = (unsigned long long)(note_start * sampleRate); ERRCHECK(channelNote->setDelay(delayNote, 0, true));