FMOD Engine User Manual 2.03
A source of audio signal that connects to the ChannelGroup mixing hierarchy.
Create with System::playSound or System::playDSP.
Playback control:
Information:
The following APIs are inherited from ChannelControl:
Playback:
Volume levels:
Spatialization:
Panning and level adjustment:
Filtering:
DSP chain configuration:
Sample accurate scheduling:
General:
Retrieves the ChannelGroup this object outputs to.
FMOD_RESULT Channel::getChannelGroup(
ChannelGroup **channelgroup
);
FMOD_RESULT FMOD_Channel_GetChannelGroup(
FMOD_CHANNEL *channel,
FMOD_CHANNELGROUP **channelgroup
);
RESULT Channel.getChannelGroup(
out ChannelGroup channelgroup
);
Channel.getChannelGroup(
channelgroup
);
See Also: Channel::setChannelGroup
Retrieves the currently playing Sound.
FMOD_RESULT Channel::getCurrentSound(
Sound **sound
);
FMOD_RESULT FMOD_Channel_GetCurrentSound(
FMOD_CHANNEL *channel,
FMOD_SOUND **sound
);
RESULT Channel.getCurrentSound(
out Sound sound
);
Channel.getCurrentSound(
sound
);
May return NULL or equivalent if no Sound is playing.
See Also: System::playSound
Retrieves the playback frequency or playback rate.
FMOD_RESULT Channel::getFrequency(
float *frequency
);
FMOD_RESULT FMOD_Channel_GetFrequency(
FMOD_CHANNEL *channel,
float *frequency
);
RESULT Channel.getFrequency(
out float frequency
);
Channel.getFrequency(
frequency
);
Playback frequency.
See Also: Channel::setFrequency
Retrieves the index of this object in the System Channel pool.
FMOD_RESULT Channel::getIndex(
int *index
);
FMOD_RESULT FMOD_Channel_GetIndex(
FMOD_CHANNEL *channel,
int *index
);
RESULT Channel.getIndex(
out int index
);
Channel.getIndex(
index
);
Index within the System Channel pool.
See Also: System::getChannel
Retrieves the number of times to loop before stopping.
FMOD_RESULT Channel::getLoopCount(
int *loopcount
);
FMOD_RESULT FMOD_Channel_GetLoopCount(
FMOD_CHANNEL *channel,
int *loopcount
);
RESULT Channel.getLoopCount(
out int loopcount
);
Channel.getLoopCount(
loopcount
);
This is the current loop countdown value that will decrement as it plays until reaching 0. Reset with Channel::setLoopCount.
Retrieves the loop start and end points.
FMOD_RESULT Channel::getLoopPoints(
unsigned int *loopstart,
FMOD_TIMEUNIT loopstarttype,
unsigned int *loopend,
FMOD_TIMEUNIT loopendtype
);
FMOD_RESULT FMOD_Channel_GetLoopPoints(
FMOD_CHANNEL *channel,
unsigned int *loopstart,
FMOD_TIMEUNIT loopstarttype,
unsigned int *loopend,
FMOD_TIMEUNIT loopendtype
);
RESULT Channel.getLoopPoints(
out uint loopstart,
TIMEUNIT loopstarttype,
out uint loopend,
TIMEUNIT loopendtype
);
Channel.getLoopPoints(
loopstart,
loopstarttype,
loopend,
loopendtype
);
Loop start point.
loopstart
. (FMOD_TIMEUNIT)Loop end point.
loopend
. (FMOD_TIMEUNIT)Valid FMOD_TIMEUNIT types are FMOD_TIMEUNIT_PCM, FMOD_TIMEUNIT_MS, FMOD_TIMEUNIT_PCMBYTES. Any other time units return FMOD_ERR_FORMAT.
If FMOD_TIMEUNIT_MS or FMOD_TIMEUNIT_PCMBYTES are used, the value is internally converted from FMOD_TIMEUNIT_PCM, so the retrieved value may not exactly match the set value.
See Also: Channel::setLoopPoints
Retrieves the current playback position.
FMOD_RESULT Channel::getPosition(
unsigned int *position,
FMOD_TIMEUNIT postype
);
FMOD_RESULT FMOD_Channel_GetPosition(
FMOD_CHANNEL *channel,
unsigned int *position,
FMOD_TIMEUNIT postype
);
RESULT Channel.getPosition(
out uint position,
TIMEUNIT postype
);
Channel.getPosition(
position,
postype
);
position
. (FMOD_TIMEUNIT)Certain FMOD_TIMEUNIT types are always available: FMOD_TIMEUNIT_PCM, FMOD_TIMEUNIT_PCMBYTES and FMOD_TIMEUNIT_MS. The others are format specific such as FMOD_TIMEUNIT_MODORDER / FMOD_TIMEUNIT_MODROW / FMOD_TIMEUNIT_MODPATTERN which is specific to files of type MOD / S3M / XM / IT.
If FMOD_TIMEUNIT_MS or FMOD_TIMEUNIT_PCMBYTES are used, the value is internally converted from FMOD_TIMEUNIT_PCM, so the retrieved value may not exactly match the set value.
See Also: Channel::setPosition
Retrieves the priority used for virtual voice ordering.
FMOD_RESULT Channel::getPriority(
int *priority
);
FMOD_RESULT FMOD_Channel_GetPriority(
FMOD_CHANNEL *channel,
int *priority
);
RESULT Channel.getPriority(
out int priority
);
Channel.getPriority(
priority
);
Priority where 0 represents most important and 256 represents least important.
Priority is used as a coarse grain control for the virtual voice system, lower priority Channels will always be stolen before higher ones. For Channels of equal priority, those with the quietest ChannelControl::getAudibility value will be stolen first.
See the Virtual Voices guide for more information.
See Also: Channel::setPriority
Retrieves whether the Channel is being emulated by the virtual voice system.
FMOD_RESULT Channel::isVirtual(
bool *isvirtual
);
FMOD_RESULT FMOD_Channel_IsVirtual(
FMOD_CHANNEL *channel,
FMOD_BOOL *isvirtual
);
RESULT Channel.isVirtual(
out bool isvirtual
);
Channel.isVirtual(
isvirtual
);
Virtual state. True = silent / emulated. False = audible / real.
See the Virtual Voices guide for more information.
See Also: ChannelControl::getAudibility
Sets the ChannelGroup this object outputs to.
FMOD_RESULT Channel::setChannelGroup(
ChannelGroup *channelgroup
);
FMOD_RESULT FMOD_Channel_SetChannelGroup(
FMOD_CHANNEL *channel,
FMOD_CHANNELGROUP *channelgroup
);
RESULT Channel.setChannelGroup(
ChannelGroup channelgroup
);
Channel.setChannelGroup(
channelgroup
);
A ChannelGroup may contain many Channels.
Channels may only output to a single ChannelGroup. This operation will remove it from the previous group first.
See Also: Channel::getChannelGroup
Sets the frequency or playback rate.
FMOD_RESULT Channel::setFrequency(
float frequency
);
FMOD_RESULT FMOD_Channel_SetFrequency(
FMOD_CHANNEL *channel,
float frequency
);
RESULT Channel.setFrequency(
float frequency
);
Channel.setFrequency(
frequency
);
Playback rate.
Default frequency is determined by the audio format of the Sound or DSP.
Sounds opened as FMOD_CREATESAMPLE (not FMOD_CREATESTREAM or FMOD_CREATECOMPRESSEDSAMPLE) can be played backwards by giving a negative frequency.
See Also: Channel::getFrequency, Sound::setDefaults
Sets the number of times to loop before stopping.
FMOD_RESULT Channel::setLoopCount(
int loopcount
);
FMOD_RESULT FMOD_Channel_SetLoopCount(
FMOD_CHANNEL *channel,
int loopcount
);
RESULT Channel.setLoopCount(
int loopcount
);
Channel.setLoopCount(
loopcount
);
The 'mode' of the Sound or Channel must be FMOD_LOOP_NORMAL or FMOD_LOOP_BIDI for this function to work.
See Also: Streaming Issues, Channel::getLoopCount, ChannelControl::setMode, Sound::setMode, System::createSound
Sets the loop start and end points.
FMOD_RESULT Channel::setLoopPoints(
unsigned int loopstart,
FMOD_TIMEUNIT loopstarttype,
unsigned int loopend,
FMOD_TIMEUNIT loopendtype
);
FMOD_RESULT FMOD_Channel_SetLoopPoints(
FMOD_CHANNEL *channel,
unsigned int loopstart,
FMOD_TIMEUNIT loopstarttype,
unsigned int loopend,
FMOD_TIMEUNIT loopendtype
);
RESULT Channel.setLoopPoints(
uint loopstart,
TIMEUNIT loopstarttype,
uint loopend,
TIMEUNIT loopendtype
);
Channel.setLoopPoints(
loopstart,
loopstarttype,
loopend,
loopendtype
);
Loop start point.
loopstart
. (FMOD_TIMEUNIT)Loop end point.
loopstart
+ 1, Sound::getLength - 1].loopend
. (FMOD_TIMEUNIT)Loop points may only be set on a Channel playing a Sound, not a Channel playing a DSP (See System::playDSP).
Valid FMOD_TIMEUNIT types are FMOD_TIMEUNIT_PCM, FMOD_TIMEUNIT_MS, FMOD_TIMEUNIT_PCMBYTES. Any other time units return FMOD_ERR_FORMAT.
If FMOD_TIMEUNIT_MS or FMOD_TIMEUNIT_PCMBYTES, the value is internally converted to FMOD_TIMEUNIT_PCM.
The Channel's mode must be set to FMOD_LOOP_NORMAL or FMOD_LOOP_BIDI for loop points to affect playback.
See Also: Streaming Issues, Channel::getLoopPoints, ChannelControl::setMode
Sets the current playback position.
FMOD_RESULT Channel::setPosition(
unsigned int position,
FMOD_TIMEUNIT postype
);
FMOD_RESULT FMOD_Channel_SetPosition(
FMOD_CHANNEL *channel,
unsigned int position,
FMOD_TIMEUNIT postype
);
RESULT Channel.setPosition(
uint position,
TIMEUNIT postype
);
Channel.setPosition(
position,
postype
);
position
. (FMOD_TIMEUNIT)Certain FMOD_TIMEUNIT types are always available: FMOD_TIMEUNIT_PCM, FMOD_TIMEUNIT_PCMBYTES and FMOD_TIMEUNIT_MS. The others are format specific such as FMOD_TIMEUNIT_MODORDER / FMOD_TIMEUNIT_MODROW / FMOD_TIMEUNIT_MODPATTERN which is specific to files of type MOD / S3M / XM / IT.
If playing a Sound created with System::createStream or FMOD_CREATESTREAM changing the position may cause a slow reflush operation while the file seek and decode occurs. You can avoid this by creating the stream with FMOD_NONBLOCKING. This will cause the stream to go into FMOD_OPENSTATE_SETPOSITION state (see Sound::getOpenState) and Sound commands will return FMOD_ERR_NOTREADY. Channel::getPosition will also not update until this non-blocking set position operation has completed.
Using a VBR source that does not have an associated seek table or seek information (such as MP3 or MOD/S3M/XM/IT) may cause inaccurate seeking if you specify FMOD_TIMEUNIT_MS or FMOD_TIMEUNIT_PCM. If you want FMOD to create a PCM vs bytes seek table so that seeking is accurate, you will have to specify FMOD_ACCURATETIME when loading or opening the sound. This means there is a slight delay as FMOD scans the whole file when loading the sound to create this table.
See Also: Channel::getPosition
Sets the priority used for virtual voice ordering.
FMOD_RESULT Channel::setPriority(
int priority
);
FMOD_RESULT FMOD_Channel_SetPriority(
FMOD_CHANNEL *channel,
int priority
);
RESULT Channel.setPriority(
int priority
);
Channel.setPriority(
priority
);
Priority where 0 represents most important and 256 represents least important.
Priority is used as a coarse grain control for the virtual voice system, lower priority Channels will always be stolen before higher ones. For Channels of equal priority, those with the quietest ChannelControl::getAudibility value will be stolen first.
See the Virtual Voices guide for more information.
See Also: Channel::getPriority