diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Applications/Piano/AudioPlayerLoop.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Applications/Piano/AudioPlayerLoop.cpp b/Userland/Applications/Piano/AudioPlayerLoop.cpp index dc19c69542..85a2768974 100644 --- a/Userland/Applications/Piano/AudioPlayerLoop.cpp +++ b/Userland/Applications/Piano/AudioPlayerLoop.cpp @@ -31,7 +31,11 @@ AudioPlayerLoop::AudioPlayerLoop(TrackManager& track_manager, bool& need_to_writ (void)buffer_id; enqueue_audio(); }; - m_resampler = Audio::ResampleHelper<double>(Music::sample_rate, m_audio_client->get_sample_rate()); + + auto target_sample_rate = m_audio_client->get_sample_rate(); + if (target_sample_rate == 0) + target_sample_rate = Music::sample_rate; + m_resampler = Audio::ResampleHelper<double>(Music::sample_rate, target_sample_rate); } void AudioPlayerLoop::enqueue_audio() |