Audio clips for the pool.
More...
#include <src/dsp/file_audio_source.h>
|
| | FileAudioSource (QObject *parent=nullptr) |
| | FileAudioSource (const fs::path &full_path, units::sample_rate_t project_sample_rate, bpm_t current_bpm, QObject *parent=nullptr) |
| | Creates an audio clip from a file.
|
| | FileAudioSource (const utils::audio::AudioBuffer &buf, utils::audio::BitDepth bit_depth, units::sample_rate_t project_sample_rate, bpm_t current_bpm, const utils::Utf8String &name, QObject *parent=nullptr) |
| | Creates an audio clip by copying the given buffer.
|
| | FileAudioSource (const float *arr, unsigned_frame_t nframes, channels_t channels, zrythm::utils::audio::BitDepth bit_depth, units::sample_rate_t project_sample_rate, bpm_t current_bpm, const utils::Utf8String &name, QObject *parent=nullptr) |
| | Creates an audio clip by copying the given interleaved float array.
|
| | FileAudioSource (channels_t channels, unsigned_frame_t nframes, units::sample_rate_t project_sample_rate, bpm_t current_bpm, const utils::Utf8String &name, QObject *parent=nullptr) |
| | Create an audio clip while recording.
|
|
Q_SIGNAL void | samplesChanged () |
| | Emitted when the source samples change.
|
| auto | get_bit_depth () const |
| auto | get_name () const |
| auto | get_bpm () const |
| const auto & | get_samples () const |
| auto | get_samplerate () const |
| void | set_name (const utils::Utf8String &name) |
| void | expand_with_frames (const utils::audio::AudioBuffer &frames) |
| | Expands (appends to the end) the frames in the clip by the given frames.
|
| void | replace_frames (const utils::audio::AudioBuffer &src_frames, unsigned_frame_t start_frame) |
| | Replaces the clip's frames starting from start_frame with frames.
|
| void | replace_frames_from_interleaved (const float *frames, unsigned_frame_t start_frame, unsigned_frame_t num_frames_per_channel, channels_t channels) |
| | Replaces the clip's frames starting from start_frame with frames.
|
| void | clear_frames () |
| | Unloads the clip's frames from memory.
|
| auto | get_num_channels () const |
| auto | get_num_frames () const |
| void | init_from_file (const fs::path &full_path, units::sample_rate_t project_sample_rate, std::optional< bpm_t > bpm_to_set) |
| | Initializes members from an audio file.
|
|
UuidIdentifiableObject & | operator= (const UuidIdentifiableObject &other)=default |
| auto | get_uuid () const |
Audio clips for the pool.
These should be loaded in the project's sample rate.
Definition at line 22 of file file_audio_source.h.
◆ AudioFile
◆ BitDepth
| using zrythm::dsp::FileAudioSource::BitDepth = zrythm::utils::audio::BitDepth |
◆ FileAudioSource() [1/5]
| zrythm::dsp::FileAudioSource::FileAudioSource |
( |
QObject * | parent = nullptr | ) |
|
|
inline |
◆ FileAudioSource() [2/5]
| zrythm::dsp::FileAudioSource::FileAudioSource |
( |
const fs::path & | full_path, |
|
|
units::sample_rate_t | project_sample_rate, |
|
|
bpm_t | current_bpm, |
|
|
QObject * | parent = nullptr ) |
Creates an audio clip from a file.
The basename of the file will be used as the name of the clip.
- Parameters
-
| current_bpm | Current BPM from TempoTrack. bpm_ will be set to this. FIXME: should this be optional? does "current" BPM make sense? |
- Exceptions
-
◆ FileAudioSource() [3/5]
| zrythm::dsp::FileAudioSource::FileAudioSource |
( |
const utils::audio::AudioBuffer & | buf, |
|
|
utils::audio::BitDepth | bit_depth, |
|
|
units::sample_rate_t | project_sample_rate, |
|
|
bpm_t | current_bpm, |
|
|
const utils::Utf8String & | name, |
|
|
QObject * | parent = nullptr ) |
Creates an audio clip by copying the given buffer.
- Parameters
-
| buf | Buffer to copy. |
| name | A name for this clip. |
◆ FileAudioSource() [4/5]
| zrythm::dsp::FileAudioSource::FileAudioSource |
( |
const float * | arr, |
|
|
unsigned_frame_t | nframes, |
|
|
channels_t | channels, |
|
|
zrythm::utils::audio::BitDepth | bit_depth, |
|
|
units::sample_rate_t | project_sample_rate, |
|
|
bpm_t | current_bpm, |
|
|
const utils::Utf8String & | name, |
|
|
QObject * | parent = nullptr ) |
|
inline |
Creates an audio clip by copying the given interleaved float array.
- Parameters
-
| arr | Interleaved array. |
| nframes | Number of frames per channel. |
| channels | Number of channels. |
| name | A name for this clip. |
Definition at line 73 of file file_audio_source.h.
◆ FileAudioSource() [5/5]
Create an audio clip while recording.
The frames will keep getting reallocated until the recording is finished.
- Parameters
-
| nframes | Number of frames to allocate. This should be the current cycle's frames when called during recording. |
◆ clear_frames()
| void zrythm::dsp::FileAudioSource::clear_frames |
( |
| ) |
|
|
inline |
◆ expand_with_frames()
Expands (appends to the end) the frames in the clip by the given frames.
- Parameters
-
| frames | Non-interleaved frames. |
◆ get_bit_depth()
| auto zrythm::dsp::FileAudioSource::get_bit_depth |
( |
| ) |
const |
|
inline |
◆ get_bpm()
| auto zrythm::dsp::FileAudioSource::get_bpm |
( |
| ) |
const |
|
inline |
◆ get_name()
| auto zrythm::dsp::FileAudioSource::get_name |
( |
| ) |
const |
|
inline |
◆ get_num_channels()
| auto zrythm::dsp::FileAudioSource::get_num_channels |
( |
| ) |
const |
|
inline |
◆ get_num_frames()
| auto zrythm::dsp::FileAudioSource::get_num_frames |
( |
| ) |
const |
|
inline |
◆ get_samplerate()
| auto zrythm::dsp::FileAudioSource::get_samplerate |
( |
| ) |
const |
|
inline |
◆ get_samples()
| const auto & zrythm::dsp::FileAudioSource::get_samples |
( |
| ) |
const |
|
inline |
◆ init_from_file()
| void zrythm::dsp::FileAudioSource::init_from_file |
( |
const fs::path & | full_path, |
|
|
units::sample_rate_t | project_sample_rate, |
|
|
std::optional< bpm_t > | bpm_to_set ) |
Initializes members from an audio file.
- Parameters
-
| full_path | Path to the file. |
| bpm_to_set | BPM of the clip to set (File BPM or 0 will be used if nullopt). |
- Exceptions
-
◆ replace_frames()
Replaces the clip's frames starting from start_frame with frames.
- Warning
- Not realtime safe.
- Parameters
-
| src_frames | Frames to copy. |
| start_frame | Frame to start copying to (src_frames are always copied from the start). |
◆ replace_frames_from_interleaved()
Replaces the clip's frames starting from start_frame with frames.
- Warning
- Not realtime safe.
- Parameters
-
| frames | Frames, interleaved. |
| start_frame | Frame to start copying to (src_frames are always copied from the start). |
◆ set_name()
◆ from_json
◆ to_json
The documentation for this class was generated from the following file: