RAII class to read and write audio files (or their metadata).
More...
#include <src/utils/audio_file.h>
|
| | AudioFile (std::filesystem::path filepath, bool for_writing=false) |
| | Creates a new instance of an AudioFile for the given path.
|
|
| AudioFile (AudioFile &&other) noexcept |
|
AudioFile & | operator= (AudioFile &&other) noexcept |
| AudioFileMetadata | read_metadata () |
| | Reads the metadata for the specified file.
|
| void | 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).
|
| void | read_full (zrythm::utils::audio::AudioBuffer &buffer, std::optional< size_t > samplerate) |
| | Simple blocking API for reading and optionally resampling audio files.
|
RAII class to read and write audio files (or their metadata).
Definition at line 43 of file audio_file.h.
◆ AudioFile()
| zrythm::utils::audio::AudioFile::AudioFile |
( |
std::filesystem::path | filepath, |
|
|
bool | for_writing = false ) |
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. |
◆ 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
-
The documentation for this class was generated from the following file: