FMOD API User Manual 2.00
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
);
See Also: Channel::setChannelGroup
Retrieves the currently playing Sound.
FMOD_RESULT Channel::getCurrentSound(
Sound **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
);
Playback frequency.
See Also: Channel::setFrequency
Retrieves the index of this object in the System Channel pool.
FMOD_RESULT Channel::getIndex(
int *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
);
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
);
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
);
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 Channel ordering.
FMOD_RESULT Channel::getPriority(
int *priority
);
Priority where 0 represents most important and 256 represents least important.
Priority is used as a coarse grain control for the virtual Channel system, lower priority Channels will always be stolen before higher. 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 Channel system.
FMOD_RESULT Channel::isVirtual(
bool *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
);
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
);
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
);
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
);
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.
See Also: Streaming Issues, Channel::getLoopPoints
Sets the current playback position.
FMOD_RESULT Channel::setPosition(
unsigned int position,
FMOD_TIMEUNIT 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 Channel ordering.
FMOD_RESULT Channel::setPriority(
int priority
);
Priority where 0 represents most important and 256 represents least important.
Priority is used as a coarse grain control for the virtual Channel system, lower priority Channels will always be stolen before higher. 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