NAP
Public Member Functions | Protected Member Functions | List of all members
AudioBufferResource Class Reference

#include <audio/resource/audiobufferresource.h>

Public Member Functions

 AudioBufferResource (Core &)
 
float getSampleRate () const
 
DiscreteTimeValue getSize () const
 
unsigned int getChannelCount () const
 
SafePtr< MultiSampleBuffergetBuffer ()
 
DiscreteTimeValue toSamples (TimeValue milliseconds) const
 
TimeValue toMilliseconds (DiscreteTimeValue samples) const
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual bool init (utility::ErrorState &errorState)
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Protected Member Functions

void setSampleRate (float sampleRate)
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Description

A buffer of multichannel audio data in memory.

Inheritance diagram for AudioBufferResource:
[legend]
Collaboration diagram for AudioBufferResource:
[legend]

Constructor & Destructor Documentation

◆ AudioBufferResource()

Member Function Documentation

◆ getBuffer()

SafePtr<MultiSampleBuffer> getBuffer ( )
Returns
: access the actual data in the buffer

◆ getChannelCount()

unsigned int getChannelCount ( ) const
Returns
: number of channels in the buffer

◆ getSampleRate()

float getSampleRate ( ) const
Returns
: sample rate at which the audio material in the buffer was sampled.

◆ getSize()

DiscreteTimeValue getSize ( ) const
Returns
: size of the buffer in samples

◆ setSampleRate()

void setSampleRate ( float  sampleRate)
protected

Sets the sample rate at which the audio material in the buffer was sampled.

◆ toMilliseconds()

TimeValue toMilliseconds ( DiscreteTimeValue  samples) const

Utility to convert a position in samples to a position in milliseconds

◆ toSamples()

DiscreteTimeValue toSamples ( TimeValue  milliseconds) const

Utility to convert a position in milliseconds to a position in samples