diff --git a/tests/host/Makefile b/tests/host/Makefile index b416bdb1..79cef61e 100644 --- a/tests/host/Makefile +++ b/tests/host/Makefile @@ -34,7 +34,7 @@ CPPOPTS=-g -Wunused-parameter -Wall -std=c++11 -m32 -include Arduino.h mp3: FORCE rm -f *.o gcc $(CCOPTS) -c $(libmad) -I ../../src/ -I. - g++ $(CPPOPTS) -o mp3 mp3.cpp Serial.cpp *.o ../../src/AudioFileSourceSTDIO.cpp ../../src/AudioOutputSTDIO.cpp ../../src/AudioFileSourceID3.cpp ../../src/AudioFileSourceBuffer.cpp ../../src/AudioGeneratorMP3.cpp -I ../../src/ -I. + g++ $(CPPOPTS) -o mp3 mp3.cpp Serial.cpp *.o ../../src/AudioFileSourceSTDIO.cpp ../../src/AudioOutputSTDIO.cpp ../../src/AudioFileSourceID3.cpp ../../src/AudioFileSourceBuffer.cpp ../../src/AudioGeneratorMP3.cpp ../../src/AudioOutputMixer.cpp -I ../../src/ -I. rm -f *.o echo valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all ./mp3 diff --git a/tests/host/mp3.cpp b/tests/host/mp3.cpp index 9f6cfe47..4a5ba7cf 100644 --- a/tests/host/mp3.cpp +++ b/tests/host/mp3.cpp @@ -4,6 +4,7 @@ #include "AudioGeneratorMP3.h" #include "AudioFileSourceID3.h" #include "AudioFileSourceBuffer.h" +#include "AudioOutputMixer.h" // Called when a metadata event occurs (i.e. an ID3 tag, an ICY block, etc. void MDCallback(void *cbData, const char *type, bool isUnicode, const char *string) @@ -51,14 +52,19 @@ int main(int argc, char **argv) id3->RegisterMetadataCB(MDCallback, (void*)"ID3TAG"); AudioOutputSTDIO *out = new AudioOutputSTDIO(); out->SetFilename("jamonit.wav"); + AudioOutputMixer *mix = new AudioOutputMixer(17, out); + AudioOutputMixerStub *stub = mix->NewInput(); void *space = malloc(29192); AudioGeneratorMP3 *mp3 = new AudioGeneratorMP3(space, 29192); - mp3->begin(id3, out); + mp3->begin(id3, stub); while (mp3->loop()) { /*noop*/ } mp3->stop(); + out->stop(); free(space); + delete stub; + delete mix; delete mp3; delete out; delete id3;