Commit 6aa0b573 authored by David Reid's avatar David Reid

Add support for disabling sigvis in the resampling test.

parent df0f5081
// We're using sigvis for visualizations. This will include mini_al for us, so no need to include mini_al in this file. // We're using sigvis for visualizations. This will include mini_al for us, so no need to include mini_al in this file.
#define NO_SIGVIS
#define MAL_NO_SSE2 #define MAL_NO_SSE2
#define MAL_NO_AVX2 #define MAL_NO_AVX2
#define MINI_SIGVIS_IMPLEMENTATION
#include "../tools/mini_sigvis/mini_sigvis.h" // <-- Includes mini_al. #ifdef NO_SIGVIS
#define MINI_AL_IMPLEMENTATION
#include "../mini_al.h"
#else
#define MINI_SIGVIS_IMPLEMENTATION
#include "../tools/mini_sigvis/mini_sigvis.h" // <-- Includes mini_al.
#endif
// There is a usage pattern for resampling that mini_al does not properly support which is where the client continuously // There is a usage pattern for resampling that mini_al does not properly support which is where the client continuously
// reads samples until mal_src_read() returns 0. The problem with this pattern is that is consumes the samples sitting // reads samples until mal_src_read() returns 0. The problem with this pattern is that is consumes the samples sitting
...@@ -100,6 +108,8 @@ int main(int argc, char** argv) ...@@ -100,6 +108,8 @@ int main(int argc, char** argv)
mal_device device; mal_device device;
mal_result result; mal_result result;
config.bufferSizeInFrames = 8192*1;
// We first play the sound the way it's meant to be played. // We first play the sound the way it's meant to be played.
result = mal_device_init(NULL, mal_device_type_playback, NULL, &config, NULL, &device); result = mal_device_init(NULL, mal_device_type_playback, NULL, &config, NULL, &device);
if (result != MAL_SUCCESS) { if (result != MAL_SUCCESS) {
...@@ -114,6 +124,7 @@ int main(int argc, char** argv) ...@@ -114,6 +124,7 @@ int main(int argc, char** argv)
mal_src_config srcConfig = mal_src_config_init(sampleRateIn, sampleRateOut, 1, on_src, NULL); mal_src_config srcConfig = mal_src_config_init(sampleRateIn, sampleRateOut, 1, on_src, NULL);
srcConfig.algorithm = mal_src_algorithm_sinc; srcConfig.algorithm = mal_src_algorithm_sinc;
srcConfig.neverConsumeEndOfInput = MAL_TRUE;
result = mal_src_init(&srcConfig, &src); result = mal_src_init(&srcConfig, &src);
if (result != MAL_SUCCESS) { if (result != MAL_SUCCESS) {
...@@ -123,7 +134,7 @@ int main(int argc, char** argv) ...@@ -123,7 +134,7 @@ int main(int argc, char** argv)
#if 0 #ifndef NO_SIGVIS
msigvis_context sigvis; msigvis_context sigvis;
result = msigvis_init(&sigvis); result = msigvis_init(&sigvis);
if (result != MAL_SUCCESS) { if (result != MAL_SUCCESS) {
...@@ -192,4 +203,4 @@ int main(int argc, char** argv) ...@@ -192,4 +203,4 @@ int main(int argc, char** argv)
#endif #endif
return 0; return 0;
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment