mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 13:43:45 +03:00
LibAudio/Wav: Always use u32
for the sample rate
This commit is contained in:
parent
901baf31ff
commit
1f62984301
Notes:
sideshowbarker
2024-07-16 18:03:21 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/1f62984301 Pull-request: https://github.com/SerenityOS/serenity/pull/23200
@ -12,14 +12,14 @@
|
||||
|
||||
namespace Audio {
|
||||
|
||||
ErrorOr<NonnullOwnPtr<WavWriter>> WavWriter::create_from_file(StringView path, int sample_rate, u16 num_channels, PcmSampleFormat sample_format)
|
||||
ErrorOr<NonnullOwnPtr<WavWriter>> WavWriter::create_from_file(StringView path, u32 sample_rate, u16 num_channels, PcmSampleFormat sample_format)
|
||||
{
|
||||
auto wav_writer = TRY(adopt_nonnull_own_or_enomem(new (nothrow) WavWriter(sample_rate, num_channels, sample_format)));
|
||||
TRY(wav_writer->set_file(path));
|
||||
return wav_writer;
|
||||
}
|
||||
|
||||
WavWriter::WavWriter(int sample_rate, u16 num_channels, PcmSampleFormat sample_format)
|
||||
WavWriter::WavWriter(u32 sample_rate, u16 num_channels, PcmSampleFormat sample_format)
|
||||
: m_sample_rate(sample_rate)
|
||||
, m_num_channels(num_channels)
|
||||
, m_sample_format(sample_format)
|
||||
|
@ -23,8 +23,8 @@ class WavWriter : public Encoder {
|
||||
AK_MAKE_NONMOVABLE(WavWriter);
|
||||
|
||||
public:
|
||||
static ErrorOr<NonnullOwnPtr<WavWriter>> create_from_file(StringView path, int sample_rate = 44100, u16 num_channels = 2, PcmSampleFormat sample_format = PcmSampleFormat::Int16);
|
||||
WavWriter(int sample_rate = 44100, u16 num_channels = 2, PcmSampleFormat sample_format = PcmSampleFormat::Int16);
|
||||
static ErrorOr<NonnullOwnPtr<WavWriter>> create_from_file(StringView path, u32 sample_rate = 44100, u16 num_channels = 2, PcmSampleFormat sample_format = PcmSampleFormat::Int16);
|
||||
WavWriter(u32 sample_rate = 44100, u16 num_channels = 2, PcmSampleFormat sample_format = PcmSampleFormat::Int16);
|
||||
~WavWriter();
|
||||
|
||||
virtual ErrorOr<void> write_samples(ReadonlySpan<Sample> samples) override;
|
||||
|
Loading…
Reference in New Issue
Block a user