|
typedef std::vector< std::vector< T > > | AudioBuffer |
|
◆ AudioFile() [1/2]
◆ AudioFile() [2/2]
Constructor, using a given file path to load a file
◆ getBitDepth()
@Returns the bit depth of each sample
◆ getLengthInSeconds()
@Returns the length in seconds of the audio file based on the number of samples and sample rate
◆ getNumChannels()
@Returns the number of audio channels in the buffer
◆ getNumSamplesPerChannel()
@Returns the number of samples per channel
◆ getSampleRate()
◆ isMono()
@Returns true if the audio file is mono
◆ isStereo()
@Returns true if the audio file is stereo
◆ load()
template<class T >
bool AudioFile< T >::load |
( |
std::string |
filePath | ) |
|
Loads an audio file from a given file path. @Returns true if the file was successfully loaded
◆ loadFromMemory()
template<class T >
bool AudioFile< T >::loadFromMemory |
( |
std::vector< uint8_t > & |
fileData | ) |
|
Loads an audio file from data in memory
◆ printSummary()
Prints a summary of the audio file to the console
◆ save()
Saves an audio file to a given file path. @Returns true if the file was successfully saved
◆ setAudioBuffer()
template<class T >
bool AudioFile< T >::setAudioBuffer |
( |
AudioBuffer & |
newBuffer | ) |
|
Set the audio buffer for this AudioFile by copying samples from another buffer. @Returns true if the buffer was copied successfully.
◆ setAudioBufferSize()
template<class T >
void AudioFile< T >::setAudioBufferSize |
( |
int |
numChannels, |
|
|
int |
numSamples |
|
) |
| |
Sets the audio buffer to a given number of channels and number of samples per channel. This will try to preserve the existing audio, adding zeros to any new channels or new samples in a given channel.
◆ setBitDepth()
template<class T >
void AudioFile< T >::setBitDepth |
( |
int |
numBitsPerSample | ) |
|
Sets the bit depth for the audio file. If you use the save() function, this bit depth rate will be used
◆ setNumChannels()
template<class T >
void AudioFile< T >::setNumChannels |
( |
int |
numChannels | ) |
|
Sets the number of channels. New channels will have the correct number of samples and be initialised to zero
◆ setNumSamplesPerChannel()
template<class T >
void AudioFile< T >::setNumSamplesPerChannel |
( |
int |
numSamples | ) |
|
Sets the number of samples per channel in the audio buffer. This will try to preserve the existing audio, adding zeros to new samples in a given channel if the number of samples is increased.
◆ setSampleRate()
template<class T >
void AudioFile< T >::setSampleRate |
( |
uint32_t |
newSampleRate | ) |
|
Sets the sample rate for the audio file. If you use the save() function, this sample rate will be used
◆ shouldLogErrorsToConsole()
template<class T >
void AudioFile< T >::shouldLogErrorsToConsole |
( |
bool |
logErrors | ) |
|
Sets whether the library should log error messages to the console. By default this is true
◆ iXMLChunk
An optional iXML chunk that can be added to the AudioFile.
◆ samples
A vector of vectors holding the audio samples for the AudioFile. You can access the samples by channel and then by sample index, i.e:
samples[channel][sampleIndex]
The documentation for this class was generated from the following file: