examples/mediaplayer: Add opus file test feature
Add TEST_OPUS for opus file playing with mediaplayer.
The opus file must be generated by mediarecorder.
@@ -99,6 +99,7 @@ void MediaPlayerTest::start(void)
*/
#define TEST_MP3
#undef TEST_AAC
+#undef TEST_OPUS
#if defined(TEST_MP3)
auto source = std::move(unique_ptr<FileInputDataSource>(new FileInputDataSource("/rom/over_16000.mp3")));
@@ -107,6 +108,8 @@ void MediaPlayerTest::start(void)
source->setPcmFormat(AUDIO_FORMAT_TYPE_S16_LE);
#elif defined(TEST_AAC)
auto source = std::move(unique_ptr<FileInputDataSource>(new FileInputDataSource("/rom/play.mp4")));
+#elif defined(TEST_OPUS)
+ auto source = std::move(unique_ptr<FileInputDataSource>(new FileInputDataSource("/rom/res_16k.mp3.pcm.opus")));
#else
auto source = std::move(unique_ptr<FileInputDataSource>(new FileInputDataSource("/rom/44100.pcm")));
source->setSampleRate(44100);
