mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
Piano: Use default sample rate in absence of audio device
This commit is contained in:
parent
87e4abb4c7
commit
55526634b6
1 changed files with 5 additions and 1 deletions
|
@ -31,7 +31,11 @@ AudioPlayerLoop::AudioPlayerLoop(TrackManager& track_manager, bool& need_to_writ
|
||||||
(void)buffer_id;
|
(void)buffer_id;
|
||||||
enqueue_audio();
|
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()
|
void AudioPlayerLoop::enqueue_audio()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue