|
TracktionEngine
|
Smart wrapper for writing to an audio file. More...
#include <tracktion_AudioFileWriter.h>
Inherits juce::ReferenceCountedObject.
Public Member Functions | |
| AudioFileWriter (const AudioFile &file, juce::AudioFormat *formatToUse, int numChannels, double sampleRate, int bitsPerSample, const juce::StringPairArray &metadata, int quality) | |
| AudioFileWriter (const AudioFile &file, juce::AudioFormat *formatToUse, int numChannels, double sampleRate, int bitsPerSample, const juce::StringPairArray &metadata, int quality, const juce::AudioChannelSet &channelLayout) | |
| ~AudioFileWriter () | |
| Destructor, calls closeForWriting. | |
| bool | isOpen () const noexcept |
| Returns true if the file is open and ready to write to. | |
| double | getSampleRate () const noexcept |
| Returns the sample rate of the writer, should only be called on an open writer. | |
| int | getNumChannels () const noexcept |
| Returns the num channels of the writer, should only be called on an open writer. | |
| bool | appendBuffer (juce::AudioBuffer< float > &buffer, int numSamples) |
| Appends an AudioBuffer to the file. | |
| bool | appendBuffer (const int **buffer, int numSamples) |
| Appends an block of samples to the file. | |
| bool | writeFromAudioReader (juce::AudioFormatReader &, SampleCount startSample, SampleCount numSamples) |
| Appends a block of samples to the file from an audio format reader. | |
| void | closeForWriting () |
| Deletes the writer and releases the file handle. | |
Public Attributes | |
| AudioFile | file |
Smart wrapper for writing to an audio file.
Internally this opens a File for writng and provides some helper methods to append to it and free the file handle when done.
| engine::AudioFileWriter::AudioFileWriter | ( | const AudioFile & | file, |
| juce::AudioFormat * | formatToUse, | ||
| int | numChannels, | ||
| double | sampleRate, | ||
| int | bitsPerSample, | ||
| const juce::StringPairArray & | metadata, | ||
| int | quality ) |
References file.
| engine::AudioFileWriter::AudioFileWriter | ( | const AudioFile & | file, |
| juce::AudioFormat * | formatToUse, | ||
| int | numChannels, | ||
| double | sampleRate, | ||
| int | bitsPerSample, | ||
| const juce::StringPairArray & | metadata, | ||
| int | quality, | ||
| const juce::AudioChannelSet & | channelLayout ) |
References file.
| engine::AudioFileWriter::~AudioFileWriter | ( | ) |
Destructor, calls closeForWriting.
|
noexcept |
Returns true if the file is open and ready to write to.
Referenced by engine::AudioFileUtils::readFromFormat(), and engine::WarpTimeRenderJob::renderNextBlock().
|
noexcept |
Returns the sample rate of the writer, should only be called on an open writer.
References getSampleRate().
Referenced by getSampleRate().
|
noexcept |
Returns the num channels of the writer, should only be called on an open writer.
References getNumChannels().
Referenced by getNumChannels().
| bool engine::AudioFileWriter::appendBuffer | ( | juce::AudioBuffer< float > & | buffer, |
| int | numSamples ) |
Appends an AudioBuffer to the file.
References appendBuffer().
Referenced by appendBuffer(), and appendBuffer().
| bool engine::AudioFileWriter::appendBuffer | ( | const int ** | buffer, |
| int | numSamples ) |
Appends an block of samples to the file.
References appendBuffer().
| bool engine::AudioFileWriter::writeFromAudioReader | ( | juce::AudioFormatReader & | , |
| SampleCount | startSample, | ||
| SampleCount | numSamples ) |
Appends a block of samples to the file from an audio format reader.
References writeFromAudioReader().
Referenced by engine::AudioFileUtils::readFromFormat(), and writeFromAudioReader().
| void engine::AudioFileWriter::closeForWriting | ( | ) |
Deletes the writer and releases the file handle.
References closeForWriting().
Referenced by closeForWriting().
| AudioFile engine::AudioFileWriter::file |
Referenced by AudioFileWriter(), and AudioFileWriter().