RAII class to read and write audio files (or their metadata).
More...
#include <src/utils/audio_file.h>
RAII class to read and write audio files (or their metadata).
Definition at line 47 of file audio_file.h.
◆ AudioFile()
| zrythm::utils::audio::AudioFile::AudioFile |
( |
fs::path | filepath, |
|
|
bool | for_writing = false ) |
|
inline |
Creates a new instance of an AudioFile for the given path.
- Parameters
-
| filepath | Path to the file. |
| for_writing | Whether to create the file for writing. |
Definition at line 58 of file audio_file.h.
◆ read_full()
Simple blocking API for reading and optionally resampling audio files.
Only to be used on small files.
- Parameters
-
| [out] | buffer | Buffer to store the result to. Its internal buffers may be re-allocated. |
| samplerate | If specified, the audio will be resampled to the given samplerate. |
- Exceptions
-
◆ read_metadata()
Reads the metadata for the specified file.
- Exceptions
-
◆ read_samples_interleaved()
| void zrythm::utils::audio::AudioFile::read_samples_interleaved |
( |
bool | in_parts, |
|
|
float * | samples, |
|
|
size_t | start_from, |
|
|
size_t | num_frames_to_read ) |
Reads the file into an internal float array (interleaved).
- Parameters
-
| samples | Samples to fill in. |
| in_parts | Whether to read the file in parts. If true, start_from and num_frames_to_read must be specified. |
| samples[out] | Pre-allocated frame array. Caller must ensure there is enough space (ie, number of frames * number of channels). |
- Exceptions
-
◆ filepath_
| fs::path zrythm::utils::audio::AudioFile::filepath_ |
◆ for_writing_
| bool zrythm::utils::audio::AudioFile::for_writing_ = false |
◆ metadata_
◆ reader_
| std::unique_ptr<juce::AudioFormatReader> zrythm::utils::audio::AudioFile::reader_ |
◆ writer_
| std::unique_ptr<juce::AudioFormatWriter> zrythm::utils::audio::AudioFile::writer_ |
The documentation for this class was generated from the following file: