LibAudio/AudioServer: Add support for playing real time audio

This commit is contained in:
2025-08-06 01:50:41 +03:00
parent 7ad3f967db
commit 7a5cfe1728
5 changed files with 123 additions and 28 deletions

View File

@@ -96,8 +96,7 @@ int main()
dprintln("AudioServer started");
constexpr uint64_t update_interval_ms = 100;
uint64_t next_update_ms = get_current_ms() + update_interval_ms;
uint64_t next_update_ms = get_current_ms();
for (;;)
{
@@ -113,11 +112,7 @@ int main()
}
const uint64_t current_ms = get_current_ms();
if (current_ms >= next_update_ms)
{
audio_server->update();
next_update_ms = current_ms + update_interval_ms;
}
next_update_ms = current_ms + audio_server->update();
const uint64_t timeout_ms = next_update_ms - current_ms;