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

Represents a loaded audio file from disk, as a umatrix More...

#include <audiofile.h>

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

Public Member Functions

 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...
 

Protected Member Functions

 AudioFile (const APE_AudioFile &audioFile)
 

Static Protected Member Functions

static APE_AudioFile loadFile (const char *relativePath, double sampleRate=APE_SampleRate_Retain)
 

Protected Attributes

double preciseLength
 
- Protected Attributes inherited from ape::umatrix< const float >
const float *const * data
 
std::size_t numRows
 
std::size_t numColumns
 

Additional Inherited Members

- Public Types inherited from ape::umatrix< const float >
typedef const float value_type
 

Detailed Description

Represents a loaded audio file from disk, as a umatrix

Constructor & Destructor Documentation

◆ AudioFile() [1/2]

ape::AudioFile::AudioFile ( const char *  relativePath)
inline

Load the file into memory, entirely.

Parameters
relativePathThe path is taken to be relative to the directory the current script is located in

◆ AudioFile() [2/2]

ape::AudioFile::AudioFile ( const APE_AudioFile audioFile)
inlineprotected

Member Function Documentation

◆ loadedOk()

bool ape::AudioFile::loadedOk ( ) const
inlinenoexcept

Test whether the file was technically loaded okay.

◆ loadFile()

static APE_AudioFile ape::AudioFile::loadFile ( const char *  relativePath,
double  sampleRate = APE_SampleRate_Retain 
)
inlinestaticprotected

◆ name()

const char* ape::AudioFile::name ( ) const
inlinenoexcept

Returns the local file name of this file

◆ operator bool()

ape::AudioFile::operator bool ( ) const
inlineexplicitnoexcept

Test whether this contains a valid audio file with valid audio data

See also
loadedOk

◆ sampleRate()

double ape::AudioFile::sampleRate ( ) const
inlinenoexcept

Returns the original sample rate of this file

Member Data Documentation

◆ preciseLength

double ape::AudioFile::preciseLength
protected

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