v1.1.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
Public Member Functions | Static Public Member Functions | List of all members
Sifteo::AssetAudio Struct Reference

An audio asset, using any supported compression codec. More...

#include <sifteo/asset/audio.h>

Public Member Functions

unsigned speed () const
 Return the default speed for this audio asset, in samples per second. More...
 

Static Public Member Functions

static AssetAudio fromPCM (const int16_t *samples, unsigned numSamples)
 Create an AssetAudio object programmatically, from uncompressed PCM data. More...
 
template<typename T >
static AssetAudio fromPCM (const T &samples)
 Templatized version of fromPCM(), for fixed-size sample arrays.
 

Detailed Description

An audio asset, using any supported compression codec.

stir generates an AssetAudio for each sound element in your assets.lua configuration file, most often from a WAV source file.

See the Audio and Asset Workflow guides for details.

Member Function Documentation

static AssetAudio Sifteo::AssetAudio::fromPCM ( const int16_t *  samples,
unsigned  numSamples 
)
inlinestatic

Create an AssetAudio object programmatically, from uncompressed PCM data.

This creates an AssetAudio instance which references the specified buffer of 16-bit uncompressed PCM samples. You can use this to wrap dynamically synthesized audio data for playback on an AudioChannel.

This is intended mostly for creating software "instruments" for real-time audio synthesis, so we default to looping mode, and there is no default sample rate or volume. These parameters can all be set via AudioChannel at runtime.

unsigned Sifteo::AssetAudio::speed ( ) const
inline

Return the default speed for this audio asset, in samples per second.

This can be used to calculate a new speed for AudioChannel::setSpeed().


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