ape  0.5.0
Audio Programming Environment
Public Member Functions | Static Public Attributes | List of all members
ape::ResampledAudioFile Class Reference

An AudioFile that can be automatically resampled to the project sample rate. More...

#include <audiofile.h>

Inheritance diagram for ape::ResampledAudioFile:
ape::AudioFile ape::umatrix< const float >

Public Member Functions

 ResampledAudioFile (const char *relativePath, double targetSampleRate=AdoptProjectRate)
 Load a resampled audio file. More...
 
double fractionalLength () const noexcept
 Length in fractional samples (if resampled) More...
 
- Public Member Functions inherited from ape::AudioFile
 AudioFile (const char *relativePath)
 Load the file into memory, entirely. More...
 
 operator bool () const noexcept
 Test whether this contains a valid audio file with valid audio data

See also
loadedOk
More...
 
bool loadedOk () const noexcept
 Test whether the file was technically loaded okay. More...
 
double sampleRate () const noexcept
 Returns the original sample rate of this file More...
 
const char * name () const noexcept
 Returns the local file name of this file More...
 
- Public Member Functions inherited from ape::umatrix< const float >
 umatrix (const float *const *data, std::size_t channelsOrRows, std::size_t samplesOrColumns)
 Construct from a pointer array. More...
 
uarray< const float > operator[] (std::size_t row) const CPPAPE_NOEXCEPT_IF_RELEASE
 Access the row in the matrix. More...
 
iterator begin () const noexcept
 Retrieve an iterator that can enumerate channels contained in this matrix. More...
 
iterator end () const noexcept
 Retrieve an iterator pointing to one past the last channel in this matrix.

See also
begin()
More...
 
std::size_t samples () const noexcept
 
std::size_t channels () const noexcept
 
std::size_t rows () const noexcept
 
See also
channels()
More...
 
std::size_t columns () const noexcept
 
See also
samples()
More...
 
auto pointers ()
 Returns a possibly cv-qualified T * const* More...
 
const auto pointers () const noexcept
 
 operator umatrix< const const float > () const noexcept
 Implicit conversion operator to a constant read-only version of this umatrix More...
 

Static Public Attributes

constexpr static double AdoptProjectRate = APE_SampleRate_Adopt
 Resample this file to the project sample rate More...
 
constexpr static double OriginalSampleRate = APE_SampleRate_Retain
 Retain this file in it's original sample rate. Equivalent to a normal AudioFile More...
 

Additional Inherited Members

- Public Types inherited from ape::umatrix< const float >
typedef const float value_type
 
- Protected Member Functions inherited from ape::AudioFile
 AudioFile (const APE_AudioFile &audioFile)
 
- Static Protected Member Functions inherited from ape::AudioFile
static APE_AudioFile loadFile (const char *relativePath, double sampleRate=APE_SampleRate_Retain)
 
- Protected Attributes inherited from ape::AudioFile
double preciseLength
 
- Protected Attributes inherited from ape::umatrix< const float >
const float *const * data
 
std::size_t numRows
 
std::size_t numColumns
 

Detailed Description

An AudioFile that can be automatically resampled to the project sample rate.

Constructor & Destructor Documentation

◆ ResampledAudioFile()

ape::ResampledAudioFile::ResampledAudioFile ( const char *  relativePath,
double  targetSampleRate = AdoptProjectRate 
)
inline

Load a resampled audio file.

Parameters
relativePathThe relative path to the file to load
targetSampleRateThe sample rate to resample to. Special values are also available: AdoptProjectRate and OriginalSampleRate

Member Function Documentation

◆ fractionalLength()

double ape::ResampledAudioFile::fractionalLength ( ) const
inlinenoexcept

Length in fractional samples (if resampled)

Member Data Documentation

◆ AdoptProjectRate

constexpr static double ape::ResampledAudioFile::AdoptProjectRate = APE_SampleRate_Adopt
staticconstexpr

Resample this file to the project sample rate

◆ OriginalSampleRate

constexpr static double ape::ResampledAudioFile::OriginalSampleRate = APE_SampleRate_Retain
staticconstexpr

Retain this file in it's original sample rate. Equivalent to a normal AudioFile


The documentation for this class was generated from the following file: