cinder::audio::SourceFile Class Reference

#include <SourceFile.h>

Inherits cinder::audio::Source.

Public Types

enum  DataType {
  UINT8, INT8, UINT16, INT16,
  UINT32, INT32, FLOAT32, DATA_UNKNOWN
}
 
typedef enum
cinder::audio::Io::DataType 
DataType
 

Public Member Functions

 ~SourceFile ()
 
virtual LoaderRef createLoader (Target *target)
 
double getDuration () const
 
int32_t getSampleRate () const
 the number of samples per second that each channel should played or recorded at. More...
 
int16_t getChannelCount () const
 the number of channels of audio data More...
 
int16_t getBitsPerSample () const
 the number of significant bits per channel in each sample More...
 
int16_t getBlockAlign () const
 the number of bytes in each sample. For interleaved data it's ussually ( sampleRate * channelCount ) / 8, for non-interleaved data ( sampleRate / 8 ). More...
 
DataType getDataType () const
 The format of the audio data. More...
 
bool isInterleaved () const
 Whether the audio data is interleaved or non-interleaved. More...
 
bool isPcm () const
 Whether or not the data is stored in Linear-PCM. More...
 
bool isFloat () const
 Whether or not the data is stored in Float format or Integer format. More...
 
bool isBigEndian () const
 Whether or not the data is big-endian. More...
 

Static Public Member Functions

static SourceRef createRef (DataSourceRef dataSourceRef)
 
static SourceFileRef createFileRef (DataSourceRef dataSourceRef)
 
static void registerSelf ()
 

Protected Member Functions

 SourceFile (DataSourceRef dataSourceRef)
 
uint64_t packetAtTime (double aTime) const
 
double timeAtPacket (uint64_t aPacket) const
 
uint64_t packetAtSample (uint64_t aSample) const
 
uint64_t sampleAtPacket (uint64_t aPacket) const
 

Static Protected Member Functions

static void loadFromCaAudioStreamBasicDescription (Io *anIo, const AudioStreamBasicDescription *audioDescription)
 

Protected Attributes

std::shared_ptr
< OpaqueAudioFileID > 
mFileRef
 
uint64_t mPacketCount
 
uint64_t mByteCount
 
double mDuration
 
uint32_t mMaxPacketSize
 
int32_t mSampleRate
 
int16_t mChannelCount
 
int16_t mBitsPerSample
 
int16_t mBlockAlign
 
DataType mDataType
 
bool mIsInterleaved
 
bool mIsPcm
 
bool mIsBigEndian
 
uint32_t mNativeFormatId
 
uint32_t mNativeFormatFlags
 
uint32_t mBytesPerPacket
 
uint32_t mFramesPerPacket
 
uint32_t mBytesPerFrame
 

Friends

class LoaderSourceFile
 

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
UINT8 
INT8 
UINT16 
INT16 
UINT32 
INT32 
FLOAT32 
DATA_UNKNOWN 

Constructor & Destructor Documentation

cinder::audio::SourceFile::~SourceFile ( )
cinder::audio::SourceFile::SourceFile ( DataSourceRef  dataSourceRef)
protected

Member Function Documentation

static SourceRef cinder::audio::SourceFile::createRef ( DataSourceRef  dataSourceRef)
static
SourceFileRef cinder::audio::SourceFile::createFileRef ( DataSourceRef  dataSourceRef)
static
virtual LoaderRef cinder::audio::SourceFile::createLoader ( Target target)
virtual

Reimplemented from cinder::audio::Source.

double cinder::audio::SourceFile::getDuration ( ) const
virtual

Implements cinder::audio::Source.

void cinder::audio::SourceFile::registerSelf ( )
static
uint64_t cinder::audio::SourceFile::packetAtTime ( double  aTime) const
protected
double cinder::audio::SourceFile::timeAtPacket ( uint64_t  aPacket) const
protected
uint64_t cinder::audio::SourceFile::packetAtSample ( uint64_t  aSample) const
protected
uint64_t cinder::audio::SourceFile::sampleAtPacket ( uint64_t  aPacket) const
protected
int32_t cinder::audio::Io::getSampleRate ( ) const
inherited

the number of samples per second that each channel should played or recorded at.

int16_t cinder::audio::Io::getChannelCount ( ) const
inherited

the number of channels of audio data

int16_t cinder::audio::Io::getBitsPerSample ( ) const
inherited

the number of significant bits per channel in each sample

int16_t cinder::audio::Io::getBlockAlign ( ) const
inherited

the number of bytes in each sample. For interleaved data it's ussually ( sampleRate * channelCount ) / 8, for non-interleaved data ( sampleRate / 8 ).

DataType cinder::audio::Io::getDataType ( ) const
inherited

The format of the audio data.

bool cinder::audio::Io::isInterleaved ( ) const
inherited

Whether the audio data is interleaved or non-interleaved.

bool cinder::audio::Io::isPcm ( ) const
inherited

Whether or not the data is stored in Linear-PCM.

bool cinder::audio::Io::isFloat ( ) const
inherited

Whether or not the data is stored in Float format or Integer format.

bool cinder::audio::Io::isBigEndian ( ) const
inherited

Whether or not the data is big-endian.

void cinder::audio::Io::loadFromCaAudioStreamBasicDescription ( Io anIo,
const AudioStreamBasicDescription *  audioDescription 
)
staticprotectedinherited

Friends And Related Function Documentation

friend class LoaderSourceFile
friend

Member Data Documentation

std::shared_ptr<OpaqueAudioFileID> cinder::audio::SourceFile::mFileRef
protected
uint64_t cinder::audio::SourceFile::mPacketCount
protected
uint64_t cinder::audio::SourceFile::mByteCount
protected
double cinder::audio::SourceFile::mDuration
protected
uint32_t cinder::audio::SourceFile::mMaxPacketSize
protected
int32_t cinder::audio::Io::mSampleRate
protectedinherited
int16_t cinder::audio::Io::mChannelCount
protectedinherited
int16_t cinder::audio::Io::mBitsPerSample
protectedinherited
int16_t cinder::audio::Io::mBlockAlign
protectedinherited
DataType cinder::audio::Io::mDataType
protectedinherited
bool cinder::audio::Io::mIsInterleaved
protectedinherited
bool cinder::audio::Io::mIsPcm
protectedinherited
bool cinder::audio::Io::mIsBigEndian
protectedinherited
uint32_t cinder::audio::Io::mNativeFormatId
protectedinherited
uint32_t cinder::audio::Io::mNativeFormatFlags
protectedinherited
uint32_t cinder::audio::Io::mBytesPerPacket
protectedinherited
uint32_t cinder::audio::Io::mFramesPerPacket
protectedinherited
uint32_t cinder::audio::Io::mBytesPerFrame
protectedinherited

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