One mixer channel, capable of playing AudioAssets.
More...
#include <sifteo/audio.h>
|
static const int32_t | MAX_VOLUME = _SYS_AUDIO_MAX_VOLUME |
| The maximum volume for an AudioChannel.
|
|
static const AudioChannelID | NUM_CHANNELS = _SYS_AUDIO_MAX_CHANNELS |
| The maximum number of supported AudioChannels in the system.
|
|
static const AudioChannelID | UNDEFINED = _SYS_AUDIO_INVALID_CHANNEL_ID |
| A reserved ID, used to mark undefined AudioChannels.
|
|
One mixer channel, capable of playing AudioAssets.
Supported sample formats are ADPCM and standard PCM format. stir
processes your audio samples as part of the application packaging process.
Loop modes available for use in play()
Enumerator |
---|
UNDEF_LOOP |
Default to the loop mode specified in Stir
|
ONCE |
Play once only (do not loop)
|
REPEAT |
Repeat indefinitely
|
Sifteo::AudioChannel::AudioChannel |
( |
| ) |
|
|
inline |
Default constructor.
By default, an AudioChannel is initialized to a special UNDEFINED value - initialize this value via init() before using the channel.
Sifteo::AudioChannel::AudioChannel |
( |
AudioChannelID |
id | ) |
|
|
inline |
Initialize an AudioChannel with a concrete value.
If you use this constructor, there is no need to call init().
- Parameters
-
id | must be in the range 0 to NUM_CHANNELS - 1 |
void Sifteo::AudioChannel::init |
( |
AudioChannelID |
id | ) |
|
|
inline |
Initialize a channel by assignging it an ID.
- Parameters
-
id | must be in the range 0 to NUM_CHANNELS - 1 |
void Sifteo::AudioChannel::pause |
( |
| ) |
const |
|
inline |
Pause the currently playing sample in this channel.
Has no effect if a sample is not currently playing.
Begin playback of a sample.
- Parameters
-
asset | specifies the audio asset to playback. |
loopMode | specifies |
void Sifteo::AudioChannel::resume |
( |
| ) |
const |
|
inline |
Resume playback on this channel.
XXX: this may go away in favor of play()
void Sifteo::AudioChannel::setSpeed |
( |
unsigned |
hz | ) |
const |
|
inline |
Sets the speed of this channel, in samples per second.
To determine the default speed for an audio sample, you can use AssetAudio::speed().
void Sifteo::AudioChannel::setVolume |
( |
int |
volume | ) |
const |
|
inline |
Sets the volume for this channel. May be applied when the channel is either stopped or playing.
- Parameters
-
volume | from 0 to MAX_VOLUME |
void Sifteo::AudioChannel::stop |
( |
| ) |
const |
|
inline |
Stop playback of the current sample.
Has no effect if a sample is not currently playing.
The documentation for this struct was generated from the following file: