mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:17:44 +00:00
LibAudio: Make ResampleHelper templated for different sample types
Previously, ResampleHelper was fixed on handling double's, which makes it unsuitable for the upcoming FLAC loader that needs to resample integers. For this reason, ResampleHelper is templated to support theoretically any type of sample, though only the necessary i32 and double are templated right now. The ResampleHelper implementations are moved from WavLoader.cpp to Buffer.cpp. This also improves some imports in the WavLoader files.
This commit is contained in:
parent
2e00155275
commit
184a9e7e67
4 changed files with 73 additions and 39 deletions
|
@ -71,7 +71,7 @@ private:
|
|||
//
|
||||
// It would avoid duplicate resampling code and would allow clients
|
||||
// to be agnostic of the destination audio device's sample rate.
|
||||
OwnPtr<ResampleHelper> m_resampler;
|
||||
OwnPtr<ResampleHelper<double>> m_resampler;
|
||||
|
||||
u32 m_sample_rate { 0 };
|
||||
u16 m_num_channels { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue