summaryrefslogtreecommitdiff
path: root/tools/spectool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/spectool.cc')
-rw-r--r--tools/spectool.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/spectool.cc b/tools/spectool.cc
index bd17dfc..c3aebb2 100644
--- a/tools/spectool.cc
+++ b/tools/spectool.cc
@@ -237,7 +237,6 @@ int play_spec(const char* in_path) {
PlatformState platform_state = platform_init(false, 100, 100);
audio_init();
- audio_start();
Spectrogram spec;
spec.spectral_data_a = spec_data.data();
spec.spectral_data_b =
@@ -247,6 +246,11 @@ int play_spec(const char* in_path) {
int spec_id = synth_register_spectrogram(&spec);
synth_trigger_voice(spec_id, 0.7f, 0.0f);
+ // Pre-fill ring buffer before starting audio device
+ const float prefill = audio_get_required_prefill_time();
+ audio_render_ahead(0.0f, prefill);
+
+ audio_start();
printf("Playing... Press Ctrl+C to exit.\n");
while (synth_get_active_voice_count() > 0 &&
!platform_should_close(&platform_state)) {