1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:47:44 +00:00

SoundPlayer: Specify the total sample count in playback device samples

The current sample count is already reported like that, so this fixes a
mismatch between current and total. In the future, we should look into
abstracting this away properly instead of requiring the user to think of
converting it manually everywhere.
This commit is contained in:
Tim Schumacher 2023-01-17 12:20:41 +01:00 committed by Jelle Raaijmakers
parent 9c7f4bafdf
commit caeb772894

View file

@ -64,7 +64,8 @@ void Player::play_file_path(DeprecatedString const& path)
m_loaded_filename = path;
total_samples_changed(loader->total_samples());
// TODO: The combination of sample count, sample rate, and sample data should be properly abstracted for the source and the playback device.
total_samples_changed(loader->total_samples() * (static_cast<float>(loader->sample_rate()) / m_playback_manager.device_sample_rate()));
m_playback_manager.set_loader(move(loader));
file_name_changed(path);