diff --git a/Userland/Libraries/LibAudio/WavWriter.cpp b/Userland/Libraries/LibAudio/WavWriter.cpp index 11e47a7143..3c295a3cf6 100644 --- a/Userland/Libraries/LibAudio/WavWriter.cpp +++ b/Userland/Libraries/LibAudio/WavWriter.cpp @@ -33,7 +33,8 @@ WavWriter::~WavWriter() ErrorOr WavWriter::set_file(StringView path) { - m_file = TRY(Core::File::open(path, Core::File::OpenMode::Write)); + auto file = TRY(Core::File::open(path, Core::File::OpenMode::Write)); + m_file = TRY(Core::OutputBufferedFile::create(move(file))); TRY(m_file->seek(44, SeekMode::SetPosition)); m_finalized = false; return {}; diff --git a/Userland/Libraries/LibAudio/WavWriter.h b/Userland/Libraries/LibAudio/WavWriter.h index 184c79016e..845eb7b06c 100644 --- a/Userland/Libraries/LibAudio/WavWriter.h +++ b/Userland/Libraries/LibAudio/WavWriter.h @@ -33,7 +33,6 @@ public: u32 sample_rate() const { return m_sample_rate; } u16 num_channels() const { return m_num_channels; } PcmSampleFormat sample_format() const { return m_sample_format; } - Core::File& file() const { return *m_file; } ErrorOr set_file(StringView path); void set_num_channels(int num_channels) { m_num_channels = num_channels; } @@ -42,7 +41,7 @@ public: private: ErrorOr write_header(); - OwnPtr m_file; + OwnPtr m_file; bool m_finalized { false }; u32 m_sample_rate;