|
ape
0.5.0
Audio Programming Environment
|
Go to the documentation of this file. 1 #ifndef CPPAPE_OUTPUTFILE_H
2 #define CPPAPE_OUTPUTFILE_H
65 channels = numChannels;
77 abort(
"Couldn't create audio file");
108 :
OutputAudioFile(whereWithExtension, cfg.outputs, cfg.sampleRate, bitsPerSample, quality)
117 : fd(other.fd), channels(other.channels)
134 channels = other.channels;
148 abort(
"Audio file not initialized");
151 abort(
"Mismatched channel count");
162 template<
typename Container>
163 auto write(
const Container& c) -> decltype(c.size(), c.data(), void())
166 abort(
"Mismatched channel count");
168 write(c.size(), c.data());
177 void write(std::size_t numSamples,
const float* data)
188 void write(std::size_t numSamples,
const float*
const* data)
APE_SharedInterface & getInterface()
Acquire the low-level C API.
Configuration structure with information needed for running a plugin.
Definition: processor.h:15
OutputAudioFile(const char *whereWithExtension, int numChannels, double sampleRate, BitDepth bitsPerSample=BitDepth::Int24, float quality=1)
Create an output file ready to be streamed.
Definition: outputfile.h:63
void write(std::size_t numSamples, const float *data)
Stream a flat buffer.
Definition: outputfile.h:177
auto pointers()
Returns a possibly cv-qualified T * const*
Definition: misc.h:341
Provides capability to record streamed audio asynchronously to a file on disk.
Definition: outputfile.h:13
void abort(const char *reason)
Terminate the script (not the host application!) safely, with a reason. All resources will automatica...
OutputAudioFile()
Default-initialize an output file.
Definition: outputfile.h:31
std::size_t channels() const noexcept
Definition: misc.h:328
OutputAudioFile(const char *whereWithExtension, const IOConfig &cfg, BitDepth bitsPerSample=BitDepth::Int24, float quality=1)
Create an output file ready to be streamed.
Definition: outputfile.h:107
void write(const umatrix< const float > &matrix)
Stream the matrix to the file.
Definition: outputfile.h:145
auto write(const Container &c) -> decltype(c.size(), c.data(), void())
Stream a container supporting .size() and .data()
Definition: outputfile.h:163
Definition: audiofile.h:7
~OutputAudioFile()
Close this file, if it hasn't been moved or properly initialized
Definition: outputfile.h:196
std::size_t samples() const noexcept
Definition: misc.h:324
void write(std::size_t numSamples, const float *const *data)
Stream a flat rectangular buffer
Definition: outputfile.h:188
OutputAudioFile(OutputAudioFile &&other)
Move and take ownership of the other file
Definition: outputfile.h:116
BitDepth
For non-compressed formats supporting it, provides a choice of bitdepths
Definition: outputfile.h:20
OutputAudioFile & operator=(OutputAudioFile &&other)
Move-assign and take ownership of the other file
Definition: outputfile.h:126