RavEngine
Loading...
Searching...
No Matches
RavEngine::AudioAsset Class Reference
Collaboration diagram for RavEngine::AudioAsset:
[legend]

Public Member Functions

 AudioAsset (const std::string &name, decltype(nchannels) desired_channels=1)
 
 AudioAsset (InterleavedSampleBufferView interleavedData, decltype(nchannels) nchannels)
 
double GetLength () const
 
decltype(nchannels) GetNChanels () const
 
auto GetData () const
 
auto GetNumSamples () const
 

Public Attributes

PlanarSampleBufferInlineView data
 

Friends

class AudioEngine
 
class AudioSyncSystem
 
class AudioSourceBase
 

Constructor & Destructor Documentation

◆ AudioAsset() [1/2]

AudioAsset::AudioAsset ( const std::string &  name,
decltype(nchannels)  desired_channels = 1 
)

Construct an AudioAsset given a file path. The AudioAsset will decode the audio into samples.

Parameters
namethe file name to load
desired_channelsthe number of channels the file should have after loading

◆ AudioAsset() [2/2]

RavEngine::AudioAsset::AudioAsset ( InterleavedSampleBufferView  interleavedData,
decltype(nchannels)  nchannels 
)
inline

Use for generated audio. The AudioAsset assumes ownership of the data and will free it on destruction.

Parameters
datathe audio sample data, in [-1,1] normalized float
n_samplesthe number of samples in the buffer. This number is not sanity-checked.
nchannelsthe number of channels in the buffer. This number is not sanity-checked.

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