mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +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:
parent
9c7f4bafdf
commit
caeb772894
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue