FMOD Engine User Manual 2.03
An interface that represents the shared APIs between Channel and ChannelGroup.
Playback:
Volume levels:
Spatialization:
Panning and level adjustment:
Filtering:
DSP chain configuration:
Sample accurate scheduling:
General:
Adds a DSP unit to the specified index in the DSP chain.
FMOD_RESULT ChannelControl::addDSP(
int index,
DSP *dsp
);
FMOD_RESULT FMOD_Channel_AddDSP(
FMOD_CHANNEL *channel,
int index,
FMOD_DSP *dsp
);
FMOD_RESULT FMOD_ChannelGroup_AddDSP(
FMOD_CHANNELGROUP *channelgroup,
int index,
FMOD_DSP *dsp
);
RESULT ChannelControl.addDSP(
int index,
DSP dsp
);
Channel.addDSP(
index,
dsp
);
ChannelGroup.addDSP(
index,
dsp
);
Offset into the DSP chain, see FMOD_CHANNELCONTROL_DSP_INDEX for special named offsets for 'head' and 'tail' and 'fader' units.
If dsp
is already added to an existing object it will be removed and then added to this object.
For detailed information on FMOD's DSP graph, read the DSP Architecture and Usage white paper.
See Also: ChannelControl::removeDSP, System::createDSP, System::createDSPByType, System::createDSPByPlugin
Adds a sample accurate fade point at a time relative to the parent ChannelGroup DSP clock.
FMOD_RESULT ChannelControl::addFadePoint(
unsigned long long dspclock,
float volume
);
FMOD_RESULT FMOD_Channel_AddFadePoint(
FMOD_CHANNEL *channel,
unsigned long long dspclock,
float volume
);
FMOD_RESULT FMOD_ChannelGroup_AddFadePoint(
FMOD_CHANNELGROUP *channelgroup,
unsigned long long dspclock,
float volume
);
RESULT ChannelControl.addFadePoint(
ulong dspclock,
float volume
);
Channel.addFadePoint(
dspclock,
volume
);
ChannelGroup.addFadePoint(
dspclock,
volume
);
DSP clock of the parent ChannelGroup to set the fade point volume.
Volume level at the given dspclock
. Values above 1.0 amplify the signal.
Fade points are scaled against other volume settings and in-between each fade point the volume will be linearly ramped.
To perform sample accurate fading use ChannelControl::getDSPClock to query the parent clock value. If a parent ChannelGroup changes its pitch, the fade points will still be correct as the parent clock rate is adjusted by that pitch.
/* Example. Ramp from full volume to half volume over the next 4096 samples */
unsigned long long parentclock;
FMOD_ChannelControl_GetDSPClock(target, NULL, &parentclock);
FMOD_ChannelControl_AddFadePoint(target, parentclock, 1.0f);
FMOD_ChannelControl_AddFadePoint(target, parentclock + 4096, 0.5f);
// Example. Ramp from full volume to half volume over the next 4096 samples
unsigned long long parentclock;
target->getDSPClock(nullptr, &parentclock);
target->addFadePoint(parentclock, 1.0f);
target->addFadePoint(parentclock + 4096, 0.5f);
See Also: ChannelControl::removeFadePoints, ChannelControl::setFadePointRamp, ChannelControl::getFadePoints
Callback for Channel or ChannelGroup notifications.
FMOD_RESULT F_CALL FMOD_CHANNELCONTROL_CALLBACK(
FMOD_CHANNELCONTROL *channelcontrol,
FMOD_CHANNELCONTROL_TYPE controltype,
FMOD_CHANNELCONTROL_CALLBACK_TYPE callbacktype,
void *commanddata1,
void *commanddata2
);
delegate RESULT CHANNELCONTROL_CALLBACK(
IntPtr channelcontrol,
CHANNELCONTROL_TYPE controltype,
CHANNELCONTROL_CALLBACK_TYPE callbacktype,
IntPtr commanddata1,
IntPtr commanddata2
);
function FMOD_CHANNELCONTROL_CALLBACK(
channelcontrol,
controltype,
callbacktype,
commanddata1,
commanddata2
)
The 'channelcontrol' argument can be cast to FMOD::Channel *
or FMOD::ChannelGroup *
given controltype
.
The 'channelcontrol' argument can be cast to FMOD_CHANNEL *
or FMOD_CHANNELGROUP *
given controltype
.
The 'channelcontrol' argument can be used via Channel
or ChannelGroup
by using FMOD.Channel channel = new FMOD.Channel(channelcontrol);
See Also: Callback Behavior, ChannelControl::setCallback
Types of callbacks called by Channels and ChannelGroups.
typedef enum FMOD_CHANNELCONTROL_CALLBACK_TYPE {
FMOD_CHANNELCONTROL_CALLBACK_END,
FMOD_CHANNELCONTROL_CALLBACK_VIRTUALVOICE,
FMOD_CHANNELCONTROL_CALLBACK_SYNCPOINT,
FMOD_CHANNELCONTROL_CALLBACK_OCCLUSION,
FMOD_CHANNELCONTROL_CALLBACK_MAX
} FMOD_CHANNELCONTROL_CALLBACK_TYPE;
enum CHANNELCONTROL_CALLBACK_TYPE : int
{
END,
VIRTUALVOICE,
SYNCPOINT,
OCCLUSION,
MAX,
}
CHANNELCONTROL_CALLBACK_END
CHANNELCONTROL_CALLBACK_VIRTUALVOICE
CHANNELCONTROL_CALLBACK_SYNCPOINT
CHANNELCONTROL_CALLBACK_OCCLUSION
CHANNELCONTROL_CALLBACK_MAX
commanddata1
: Unused.commanddata2
: Unused.commanddata1
: (int) 0 represents 'virtual to real' and 1 represents 'real to virtual'.commanddata2
: Unused.commanddata1
: (int) representing the index of the sync point for use with Sound::getSyncPointInfo.commanddata2
: Unused.commanddata1
: (float *) representing the calculated direct occlusion value, can be modified.commanddata2
: (float *) representing the calculated reverb occlusion value, can be modified.commanddata1
and commanddata2
are parameters passed into the callback and each callback may interpret them differently as specified above. See FMOD_CHANNELCONTROL_CALLBACK.
Callbacks are called from the game thread when set from the Core API or Studio API in synchronous mode, and from the Studio Update Thread when in default / async mode.
See Also: Callback Behavior, ChannelControl::setCallback
References to built-in DSP positions that reside in a Channel or ChannelGroup's DSP chain.
typedef enum FMOD_CHANNELCONTROL_DSP_INDEX {
FMOD_CHANNELCONTROL_DSP_HEAD = -1,
FMOD_CHANNELCONTROL_DSP_FADER = -2,
FMOD_CHANNELCONTROL_DSP_TAIL = -3
} FMOD_CHANNELCONTROL_DSP_INDEX;
struct CHANNELCONTROL_DSP_INDEX
{
const int HEAD = -1;
const int FADER = -2;
const int TAIL = -3;
}
CHANNELCONTROL_DSP_HEAD = -1
CHANNELCONTROL_DSP_FADER = -2
CHANNELCONTROL_DSP_TAIL = -3
Before any DSPs have been added by the user, there is only one DSP available for a Channel or ChannelGroup. This is of type FMOD_DSP_TYPE_FADER. This handles volume and panning for a Channel or ChannelGroup.
As only 1 DSP exists by default, initially CHANNELCONTROL_DSP_HEAD
, CHANNELCONTROL_DSP_TAIL
and CHANNELCONTROL_DSP_FADER
all reference the same DSP.
See Also: ChannelControl::getDSP, ChannelControl::getNumDSPs, ChannelControl::setDSPIndex
Retrieves the 3D position and velocity used to apply panning, attenuation and doppler.
FMOD_RESULT ChannelControl::get3DAttributes(
FMOD_VECTOR *pos,
FMOD_VECTOR *vel
);
FMOD_RESULT FMOD_Channel_Get3DAttributes(
FMOD_CHANNEL *channel,
FMOD_VECTOR *pos,
FMOD_VECTOR *vel
);
FMOD_RESULT FMOD_ChannelGroup_Get3DAttributes(
FMOD_CHANNELGROUP *channelgroup,
FMOD_VECTOR *pos,
FMOD_VECTOR *vel
);
RESULT ChannelControl.get3DAttributes(
out VECTOR pos,
out VECTOR vel
);
Channel.get3DAttributes(
pos,
vel
);
ChannelGroup.get3DAttributes(
pos,
vel
);
Position in 3D space used for panning and attenuation. (FMOD_VECTOR)
Velocity in 3D space used for doppler. (FMOD_VECTOR)
See Also: ChannelControl::set3DAttributes
Retrieves the orientation of a 3D cone shape, used for simulated occlusion.
FMOD_RESULT ChannelControl::get3DConeOrientation(
FMOD_VECTOR *orientation
);
FMOD_RESULT FMOD_Channel_Get3DConeOrientation(
FMOD_CHANNEL *channel,
FMOD_VECTOR *orientation
);
FMOD_RESULT FMOD_ChannelGroup_Get3DConeOrientation(
FMOD_CHANNELGROUP *channelgroup,
FMOD_VECTOR *orientation
);
RESULT ChannelControl.get3DConeOrientation(
out VECTOR orientation
);
Channel.get3DConeOrientation(
orientation
);
ChannelGroup.get3DConeOrientation(
orientation
);
Normalized orientation vector, which represents the direction of the sound cone. (FMOD_VECTOR)
See Also: ChannelControl::set3DConeOrientation
Retrieves the angles and attenuation levels of a 3D cone shape, for simulated occlusion which is based on direction.
FMOD_RESULT ChannelControl::get3DConeSettings(
float *insideconeangle,
float *outsideconeangle,
float *outsidevolume
);
FMOD_RESULT FMOD_Channel_Get3DConeSettings(
FMOD_CHANNEL *channel,
float *insideconeangle,
float *outsideconeangle,
float *outsidevolume
);
FMOD_RESULT FMOD_ChannelGroup_Get3DConeSettings(
FMOD_CHANNELGROUP *channelgroup,
float *insideconeangle,
float *outsideconeangle,
float *outsidevolume
);
RESULT ChannelControl.get3DConeSettings(
out float insideconeangle,
out float outsideconeangle,
out float outsidevolume
);
Channel.get3DConeSettings(
insideconeangle,
outsideconeangle,
outsidevolume
);
ChannelGroup.get3DConeSettings(
insideconeangle,
outsideconeangle,
outsidevolume
);
Inside cone angle. This is the angle spread within which the sound is unattenuated.
Outside cone angle. This is the angle spread outside of which the sound is attenuated to its outsidevolume
.
Cone outside volume.
When ChannelControl::set3DConeOrientation is used and a 3D 'cone' is set up, attenuation will automatically occur for a sound based on the relative angle of the direction the cone is facing, vs the angle between the sound and the listener.
insideconeangle
, the sound will not have any attenuation applied.insideconeangle
and outsideconeangle
, linear volume attenuation (between 1 and outsidevolume
) is applied between the two angles until it reaches the outsideconeangle
.outsideconeangle
the volume does not attenuate any further.See Also: ChannelControl::set3DConeSettings
Retrieves the current custom roll-off shape for 3D distance attenuation.
FMOD_RESULT ChannelControl::get3DCustomRolloff(
FMOD_VECTOR **points,
int *numpoints
);
FMOD_RESULT FMOD_Channel_Get3DCustomRolloff(
FMOD_CHANNEL *channel,
FMOD_VECTOR **points,
int *numpoints
);
FMOD_RESULT FMOD_ChannelGroup_Get3DCustomRolloff(
FMOD_CHANNELGROUP *channelgroup,
FMOD_VECTOR **points,
int *numpoints
);
RESULT ChannelControl.get3DCustomRolloff(
out IntPtr points,
out int numpoints
);
Channel.get3DCustomRolloff(
points,
numpoints
);
ChannelGroup.get3DCustomRolloff(
points,
numpoints
);
Array of vectors sorted by distance, where x
= distance and y
= volume from 0 to 1. z
is unused. (FMOD_VECTOR)
points
array.See Also: ChannelControl::set3DCustomRolloff
Retrieves the override values for the 3D distance filter.
FMOD_RESULT ChannelControl::get3DDistanceFilter(
bool *custom,
float *customLevel,
float *centerFreq
);
FMOD_RESULT FMOD_Channel_Get3DDistanceFilter(
FMOD_CHANNEL *channel,
FMOD_BOOL *custom,
float *customLevel,
float *centerFreq
);
FMOD_RESULT FMOD_ChannelGroup_Get3DDistanceFilter(
FMOD_CHANNELGROUP *channelgroup,
FMOD_BOOL *custom,
float *customLevel,
float *centerFreq
);
RESULT ChannelControl.get3DDistanceFilter(
out bool custom,
out float customLevel,
out float centerFreq
);
Channel.get3DDistanceFilter(
custom,
customLevel,
centerFreq
);
ChannelGroup.get3DDistanceFilter(
custom,
customLevel,
centerFreq
);
Override automatic distance filtering and use customLevel
instead.
Attenuation factor where 1 represents no attenuation and 0 represents complete attenuation.
Center frequency of the band-pass filter used to simulate distance attenuation, 0 for default of FMOD_ADVANCEDSETTINGS::distanceFilterCenterFreq.
See Also: ChannelControl::set3DDistanceFilter
Retrieves the amount by which doppler is scaled.
FMOD_RESULT ChannelControl::get3DDopplerLevel(
float *level
);
FMOD_RESULT FMOD_Channel_Get3DDopplerLevel(
FMOD_CHANNEL *channel,
float *level
);
FMOD_RESULT FMOD_ChannelGroup_Get3DDopplerLevel(
FMOD_CHANNELGROUP *channelgroup,
float *level
);
RESULT ChannelControl.get3DDopplerLevel(
out float level
);
Channel.get3DDopplerLevel(
level
);
ChannelGroup.get3DDopplerLevel(
level
);
Doppler scale where 0 represents no doppler, 1 represents natural doppler and 5 represents exaggerated doppler.
See Also: ChannelControl::set3DDopplerLevel
Retrieves the blend between 3D panning and 2D panning.
FMOD_RESULT ChannelControl::get3DLevel(
float *level
);
FMOD_RESULT FMOD_Channel_Get3DLevel(
FMOD_CHANNEL *channel,
float *level
);
FMOD_RESULT FMOD_ChannelGroup_Get3DLevel(
FMOD_CHANNELGROUP *channelgroup,
float *level
);
RESULT ChannelControl.get3DLevel(
out float level
);
Channel.get3DLevel(
level
);
ChannelGroup.get3DLevel(
level
);
3D pan level where 0 represents panning/attenuating solely with 2D panning functions and 1 represents solely 3D.
The FMOD_3D flag must be set on this object otherwise FMOD_ERR_NEEDS3D is returned.
2D functions include:
3D functions include:
See Also: ChannelControl::set3DLevel
Retrieves the minimum and maximum distances used to calculate the 3D roll-off attenuation.
FMOD_RESULT ChannelControl::get3DMinMaxDistance(
float *mindistance,
float *maxdistance
);
FMOD_RESULT FMOD_Channel_Get3DMinMaxDistance(
FMOD_CHANNEL *channel,
float *mindistance,
float *maxdistance
);
FMOD_RESULT FMOD_ChannelGroup_Get3DMinMaxDistance(
FMOD_CHANNELGROUP *channelgroup,
float *mindistance,
float *maxdistance
);
RESULT ChannelControl.get3DMinMaxDistance(
out float mindistance,
out float maxdistance
);
Channel.get3DMinMaxDistance(
mindistance,
maxdistance
);
ChannelGroup.get3DMinMaxDistance(
mindistance,
maxdistance
);
Distance from the source where attenuation begins.
Distance from the source where attenuation ends.
mindistance
, inf)See Also: ChannelControl::set3DMinMaxDistance, System::set3DSettings
Retrieves the 3D attenuation factors for the direct and reverb paths.
FMOD_RESULT ChannelControl::get3DOcclusion(
float *directocclusion,
float *reverbocclusion
);
FMOD_RESULT FMOD_Channel_Get3DOcclusion(
FMOD_CHANNEL *channel,
float *directocclusion,
float *reverbocclusion
);
FMOD_RESULT FMOD_ChannelGroup_Get3DOcclusion(
FMOD_CHANNELGROUP *channelgroup,
float *directocclusion,
float *reverbocclusion
);
RESULT ChannelControl.get3DOcclusion(
out float directocclusion,
out float reverbocclusion
);
Channel.get3DOcclusion(
directocclusion,
reverbocclusion
);
ChannelGroup.get3DOcclusion(
directocclusion,
reverbocclusion
);
Occlusion factor for the direct path where 0 represents no occlusion and 1 represents full occlusion.
Occlusion factor for the reverb path where 0 represents no occlusion and 1 represents full occlusion.
See Also: ChannelControl::set3DOcclusion
Retrieves the spread of a 3D sound in speaker space.
FMOD_RESULT ChannelControl::get3DSpread(
float *angle
);
FMOD_RESULT FMOD_Channel_Get3DSpread(
FMOD_CHANNEL *channel,
float *angle
);
FMOD_RESULT FMOD_ChannelGroup_Get3DSpread(
FMOD_CHANNELGROUP *channelgroup,
float *angle
);
RESULT ChannelControl.get3DSpread(
out float angle
);
Channel.get3DSpread(
angle
);
ChannelGroup.get3DSpread(
angle
);
Angle over which the sound is spread.
See Also: ChannelControl::set3DSpread
Gets the calculated audibility based on all attenuation factors which contribute to the final output volume.
FMOD_RESULT ChannelControl::getAudibility(
float *audibility
);
FMOD_RESULT FMOD_Channel_GetAudibility(
FMOD_CHANNEL *channel,
float *audibility
);
FMOD_RESULT FMOD_ChannelGroup_GetAudibility(
FMOD_CHANNELGROUP *channelgroup,
float *audibility
);
RESULT ChannelControl.getAudibility(
out float audibility
);
Channel.getAudibility(
audibility
);
ChannelGroup.getAudibility(
audibility
);
The estimated volume is calculated using a number of factors which are detailed in the Virtual Voice System white paper.
While this does not represent the actual waveform, Channels playing FSB files will take into consideration the overall peak level of the file (if available).
This value is used to determine which Channels should be audible and which Channels to virtualize when resources are limited.
See Also: Channel::isVirtual, ChannelControl::getVolume, ChannelControl::get3DOcclusion, ChannelControl::get3DAttributes, FMOD_DSP_PARAMETER_OVERALLGAIN
Retrieves a sample accurate start (and/or stop) time relative to the parent ChannelGroup DSP clock.
FMOD_RESULT ChannelControl::getDelay(
unsigned long long *dspclock_start,
unsigned long long *dspclock_end,
bool *stopchannels = nullptr
);
FMOD_RESULT FMOD_Channel_GetDelay(
FMOD_CHANNEL *channel,
unsigned long long *dspclock_start,
unsigned long long *dspclock_end,
FMOD_BOOL *stopchannels
);
FMOD_RESULT FMOD_ChannelGroup_GetDelay(
FMOD_CHANNELGROUP *channelgroup,
unsigned long long *dspclock_start,
unsigned long long *dspclock_end,
FMOD_BOOL *stopchannels
);
RESULT ChannelControl.getDelay(
out ulong dspclock_start,
out ulong dspclock_end
);
RESULT ChannelControl.getDelay(
out ulong dspclock_start,
out ulong dspclock_end,
out bool stopchannels
);
Channel.getDelay(
dspclock_start,
dspclock_end,
stopchannels
);
ChannelGroup.getDelay(
dspclock_start,
dspclock_end,
stopchannels
);
DSP clock of the parent ChannelGroup to audibly start playing sound at.
DSP clock of the parent ChannelGroup to audibly stop playing sound at.
True: When dspclock_end
is reached, behaves like ChannelControl::stop has been called.
False: When dspclock_end
is reached, behaves like ChannelControl::setPaused has been called, a subsequent dspclock_start
allows it to resume.
See Also: ChannelControl::setDelay,ChannelControl::getDSPClock
Retrieves the DSP unit at the specified index in the DSP chain.
FMOD_RESULT ChannelControl::getDSP(
int index,
DSP **dsp
);
FMOD_RESULT FMOD_Channel_GetDSP(
FMOD_CHANNEL *channel,
int index,
FMOD_DSP **dsp
);
FMOD_RESULT FMOD_ChannelGroup_GetDSP(
FMOD_CHANNELGROUP *channelgroup,
int index,
FMOD_DSP **dsp
);
RESULT ChannelControl.getDSP(
int index,
out DSP dsp
);
Channel.getDSP(
index,
dsp
);
ChannelGroup.getDSP(
index,
dsp
);
Offset into the DSP chain, see FMOD_CHANNELCONTROL_DSP_INDEX for special named offsets for 'head' and 'tail' and 'fader' units.
index
. (DSP)Retrieves the DSP clock values at this point in time.
FMOD_RESULT ChannelControl::getDSPClock(
unsigned long long *dspclock,
unsigned long long *parentclock
);
FMOD_RESULT FMOD_Channel_GetDSPClock(
FMOD_CHANNEL *channel,
unsigned long long *dspclock,
unsigned long long *parentclock
);
FMOD_RESULT FMOD_ChannelGroup_GetDSPClock(
FMOD_CHANNELGROUP *channelgroup,
unsigned long long *dspclock,
unsigned long long *parentclock
);
RESULT ChannelControl.getDSPClock(
out ulong dspclock,
out ulong parentclock
);
Channel.getDSPClock(
dspclock,
parentclock
);
ChannelGroup.getDSPClock(
dspclock,
parentclock
);
DSP clock value for the tail DSP (FMOD_CHANNELCONTROL_DSP_TAIL) node.
DSP clock value for the tail DSP (FMOD_CHANNELCONTROL_DSP_TAIL) node of the parent ChannelGroup.
To perform sample accurate scheduling in conjunction with ChannelControl::setDelay and ChannelControl::addFadePoint query the parentclock
value.
See Also: ChannelControl::getDelay
Retrieves the index of a DSP inside the Channel or ChannelGroup's DSP chain.
FMOD_RESULT ChannelControl::getDSPIndex(
DSP *dsp,
int *index
);
FMOD_RESULT FMOD_Channel_GetDSPIndex(
FMOD_CHANNEL *channel,
FMOD_DSP *dsp,
int *index
);
FMOD_RESULT FMOD_ChannelGroup_GetDSPIndex(
FMOD_CHANNELGROUP *channelgroup,
FMOD_DSP *dsp,
int *index
);
RESULT ChannelControl.getDSPIndex(
DSP dsp,
out int index
);
Channel.getDSPIndex(
dsp,
index
);
ChannelGroup.getDSPIndex(
dsp,
index
);
See Also: ChannelControl::setDSPIndex
Retrieves information about stored fade points.
FMOD_RESULT ChannelControl::getFadePoints(
unsigned int *numpoints,
unsigned long long *point_dspclock,
float *point_volume
);
FMOD_RESULT FMOD_Channel_GetFadePoints(
FMOD_CHANNEL *channel,
unsigned int *numpoints,
unsigned long long *point_dspclock,
float *point_volume
);
FMOD_RESULT FMOD_ChannelGroup_GetFadePoints(
FMOD_CHANNELGROUP *channelgroup,
unsigned int *numpoints,
unsigned long long *point_dspclock,
float *point_volume
);
RESULT ChannelControl.getFadePoints(
ref uint numpoints,
ulong[] point_dspclock,
float[] point_volume
);
Channel.getFadePoints(
numpoints,
point_dspclock,
point_volume
);
ChannelGroup.getFadePoints(
numpoints,
point_dspclock,
point_volume
);
Array of DSP clock values that represent the fade point times.
Array of volume levels that represent the fade point values.
Passing NULL for point_dspclock
and point_volume
will allow you to query the number of fade points stored, with result stored in numpoints
.
If numpoints
is specified by the user, the value will be used as an input for the maximum number of fade points to output. It will then output as the number of fadepoints retrieved.
See Also: ChannelControl::addFadePoint, ChannelControl::setFadePointRamp, ChannelControl::removeFadePoints
Retrieves the gain of the dry signal when built in lowpass / distance filtering is applied.
FMOD_RESULT ChannelControl::getLowPassGain(
float *gain
);
FMOD_RESULT FMOD_Channel_GetLowPassGain(
FMOD_CHANNEL *channel,
float *gain
);
FMOD_RESULT FMOD_ChannelGroup_GetLowPassGain(
FMOD_CHANNELGROUP *channelgroup,
float *gain
);
RESULT ChannelControl.getLowPassGain(
out float gain
);
Channel.getLowPassGain(
gain
);
ChannelGroup.getLowPassGain(
gain
);
gain level where 0 represents silent (full filtering) and 1 represents full volume (no filtering).
Requires the built in lowpass to be created with FMOD_INIT_CHANNEL_LOWPASS or FMOD_INIT_CHANNEL_DISTANCEFILTER.
Currently only supported for Channel, not ChannelGroup.
See Also: ChannelControl::setLowPassGain
Retrieves a 2 dimensional pan matrix that maps the signal from input channels (columns) to output speakers (rows).
FMOD_RESULT ChannelControl::getMixMatrix(
float *matrix,
int *outchannels,
int *inchannels,
int inchannel_hop = 0
);
FMOD_RESULT FMOD_Channel_GetMixMatrix(
FMOD_CHANNEL *channel,
float *matrix,
int *outchannels,
int *inchannels,
int inchannel_hop
);
FMOD_RESULT FMOD_ChannelGroup_GetMixMatrix(
FMOD_CHANNELGROUP *channelgroup,
float *matrix,
int *outchannels,
int *inchannels,
int inchannel_hop
);
RESULT ChannelControl.getMixMatrix(
float[] matrix,
out int outchannels,
out int inchannels,
int inchannel_hop = 0
);
Channel.getMixMatrix(
matrix,
outchannels,
inchannels,
inchannel_hop
);
ChannelGroup.getMixMatrix(
matrix,
outchannels,
inchannels,
inchannel_hop
);
Two dimensional array of volume levels in row-major order. Each row represents an output speaker, each column represents an input channel.
matrix
.matrix
. A matrix element is referenced as 'outchannel * inchannel_hop + inchannel'.Passing NULL for matrix
will allow you to query outchannels
and inchannels
otherwise they are not optional.
Matrix element values can be below 0 to invert a signal and above 1 to amplify the signal. Note that increasing the signal level too far may cause audible distortion.
See Also: ChannelControl::setMixMatrix
Retrieves the playback mode bits that control how this object behaves.
FMOD_RESULT ChannelControl::getMode(
FMOD_MODE *mode
);
FMOD_RESULT FMOD_Channel_GetMode(
FMOD_CHANNEL *channel,
FMOD_MODE *mode
);
FMOD_RESULT FMOD_ChannelGroup_GetMode(
FMOD_CHANNELGROUP *channelgroup,
FMOD_MODE *mode
);
RESULT ChannelControl.getMode(
out MODE mode
);
Channel.getMode(
mode
);
ChannelGroup.getMode(
mode
);
See Also: ChannelControl::setMode
Retrieves the mute state.
FMOD_RESULT ChannelControl::getMute(
bool *mute
);
FMOD_RESULT FMOD_Channel_GetMute(
FMOD_CHANNEL *channel,
FMOD_BOOL *mute
);
FMOD_RESULT FMOD_ChannelGroup_GetMute(
FMOD_CHANNELGROUP *channelgroup,
FMOD_BOOL *mute
);
RESULT ChannelControl.getMute(
out bool mute
);
Channel.getMute(
mute
);
ChannelGroup.getMute(
mute
);
Mute state. True = silent. False = audible.
An individual mute state is kept for each object, a parent ChannelGroup being muted will effectively mute this object however when queried the individual mute state is returned. ChannelControl::getAudibility can be used to calculate overall audibility for a Channel or ChannelGroup.
See Also: ChannelControl::setMute
Retrieves the number of DSP units in the DSP chain.
FMOD_RESULT ChannelControl::getNumDSPs(
int *numdsps
);
FMOD_RESULT FMOD_Channel_GetNumDSPs(
FMOD_CHANNEL *channel,
int *numdsps
);
FMOD_RESULT FMOD_ChannelGroup_GetNumDSPs(
FMOD_CHANNELGROUP *channelgroup,
int *numdsps
);
RESULT ChannelControl.getNumDSPs(
out int numdsps
);
Channel.getNumDSPs(
numdsps
);
ChannelGroup.getNumDSPs(
numdsps
);
See Also: ChannelControl::addDSP, ChannelControl::removeDSP, ChannelControl::getDSP
Retrieves the paused state.
FMOD_RESULT ChannelControl::getPaused(
bool *paused
);
FMOD_RESULT FMOD_Channel_GetPaused(
FMOD_CHANNEL *channel,
FMOD_BOOL *paused
);
FMOD_RESULT FMOD_ChannelGroup_GetPaused(
FMOD_CHANNELGROUP *channelgroup,
FMOD_BOOL *paused
);
RESULT ChannelControl.getPaused(
out bool paused
);
Channel.getPaused(
paused
);
ChannelGroup.getPaused(
paused
);
Paused state. True = playback halted. False = playback active.
An individual pause state is kept for each object, a parent ChannelGroup being paused will effectively pause this object however when queried the individual pause state is returned.
See Also: ChannelControl::setPaused
Retrieves the relative pitch / playback rate.
FMOD_RESULT ChannelControl::getPitch(
float *pitch
);
FMOD_RESULT FMOD_Channel_GetPitch(
FMOD_CHANNEL *channel,
float *pitch
);
FMOD_RESULT FMOD_ChannelGroup_GetPitch(
FMOD_CHANNELGROUP *channelgroup,
float *pitch
);
RESULT ChannelControl.getPitch(
out float pitch
);
Channel.getPitch(
pitch
);
ChannelGroup.getPitch(
pitch
);
An individual pitch value is kept for each object, a parent ChannelGroup pitch will effectively scale the pitch of this object however when queried the individual pitch value is returned.
See Also: ChannelControl::setPitch
Retrieves the wet / send level for a particular reverb instance.
FMOD_RESULT ChannelControl::getReverbProperties(
int instance,
float *wet
);
FMOD_RESULT FMOD_Channel_GetReverbProperties(
FMOD_CHANNEL *channel,
int instance,
float *wet
);
FMOD_RESULT FMOD_ChannelGroup_GetReverbProperties(
FMOD_CHANNELGROUP *channelgroup,
int instance,
float *wet
);
RESULT ChannelControl.getReverbProperties(
int instance,
out float wet
);
Channel.getReverbProperties(
instance,
wet
);
ChannelGroup.getReverbProperties(
instance,
wet
);
Reverb instance index.
Send level for the signal to the reverb. 0 = none, 1 = full.
See Also: ChannelControl::setReverbProperties
Retrieves the System that created this object.
FMOD_RESULT ChannelControl::getSystemObject(
System **system
);
FMOD_RESULT FMOD_Channel_GetSystemObject(
FMOD_CHANNEL *channel,
FMOD_SYSTEM **system
);
FMOD_RESULT FMOD_ChannelGroup_GetSystemObject(
FMOD_CHANNELGROUP *channelgroup,
FMOD_SYSTEM **system
);
RESULT ChannelControl.getSystemObject(
out System system
);
Channel.getSystemObject(
system
);
ChannelGroup.getSystemObject(
system
);
See Also: System::createChannelGroup, System::getMasterChannelGroup, System::playSound
Retrieves a user value associated with this object.
FMOD_RESULT ChannelControl::getUserData(
void **userdata
);
FMOD_RESULT FMOD_Channel_GetUserData(
FMOD_CHANNEL *channel,
void **userdata
);
FMOD_RESULT FMOD_ChannelGroup_GetUserData(
FMOD_CHANNELGROUP *channelgroup,
void **userdata
);
RESULT ChannelControl.getUserData(
out IntPtr userdata
);
Channel.getUserData(
userdata
);
ChannelGroup.getUserData(
userdata
);
This function allows arbitrary user data to be retrieved from this object. See the User Data section of the glossary for an example of how to get and set user data.
Retrieves the volume level.
FMOD_RESULT ChannelControl::getVolume(
float *volume
);
FMOD_RESULT FMOD_Channel_GetVolume(
FMOD_CHANNEL *channel,
float *volume
);
FMOD_RESULT FMOD_ChannelGroup_GetVolume(
FMOD_CHANNELGROUP *channelgroup,
float *volume
);
RESULT ChannelControl.getVolume(
out float volume
);
Channel.getVolume(
volume
);
ChannelGroup.getVolume(
volume
);
Volume level.
See Also: ChannelControl::setVolume
Retrieves whether volume changes are ramped or instantaneous.
FMOD_RESULT ChannelControl::getVolumeRamp(
bool *ramp
);
FMOD_RESULT FMOD_Channel_GetVolumeRamp(
FMOD_CHANNEL *channel,
FMOD_BOOL *ramp
);
FMOD_RESULT FMOD_ChannelGroup_GetVolumeRamp(
FMOD_CHANNELGROUP *channelgroup,
FMOD_BOOL *ramp
);
RESULT ChannelControl.getVolumeRamp(
out bool ramp
);
Channel.getVolumeRamp(
ramp
);
ChannelGroup.getVolumeRamp(
ramp
);
Ramp state. True = volume change is ramped. False = volume change is instantaeous.
See Also: ChannelControl::setVolumeRamp
Retrieves the playing state.
FMOD_RESULT ChannelControl::isPlaying(
bool *isplaying
);
FMOD_RESULT FMOD_Channel_IsPlaying(
FMOD_CHANNEL *channel,
FMOD_BOOL *isplaying
);
FMOD_RESULT FMOD_ChannelGroup_IsPlaying(
FMOD_CHANNELGROUP *channelgroup,
FMOD_BOOL *isplaying
);
RESULT ChannelControl.isPlaying(
out bool isplaying
);
Channel.isPlaying(
isplaying
);
ChannelGroup.isPlaying(
isplaying
);
Playing state.
A Channel is considered playing after System::playSound or System::playDSP, even if it is paused.
A ChannelGroup is considered playing if it has any playing Channels.
Removes the specified DSP unit from the DSP chain.
FMOD_RESULT ChannelControl::removeDSP(
DSP *dsp
);
FMOD_RESULT FMOD_Channel_RemoveDSP(
FMOD_CHANNEL *channel,
FMOD_DSP *dsp
);
FMOD_RESULT FMOD_ChannelGroup_RemoveDSP(
FMOD_CHANNELGROUP *channelgroup,
FMOD_DSP *dsp
);
RESULT ChannelControl.removeDSP(
DSP dsp
);
Channel.removeDSP(
dsp
);
ChannelGroup.removeDSP(
dsp
);
See Also: ChannelControl::addDSP, ChannelControl::getDSP, ChannelControl::getNumDSPs
Removes all fade points between the two specified clock values (inclusive).
FMOD_RESULT ChannelControl::removeFadePoints(
unsigned long long dspclock_start,
unsigned long long dspclock_end
);
FMOD_RESULT FMOD_Channel_RemoveFadePoints(
FMOD_CHANNEL *channel,
unsigned long long dspclock_start,
unsigned long long dspclock_end
);
FMOD_RESULT FMOD_ChannelGroup_RemoveFadePoints(
FMOD_CHANNELGROUP *channelgroup,
unsigned long long dspclock_start,
unsigned long long dspclock_end
);
RESULT ChannelControl.removeFadePoints(
ulong dspclock_start,
ulong dspclock_end
);
Channel.removeFadePoints(
dspclock_start,
dspclock_end
);
ChannelGroup.removeFadePoints(
dspclock_start,
dspclock_end
);
DSP clock of the parent ChannelGroup at which to begin removing fade points.
DSP clock of the parent ChannelGroup at which to stop removing fade points.
See Also: ChannelControl::addFadePoint, ChannelControl::setFadePointRamp, ChannelControl::getFadePoints
Sets the 3D position and velocity used to apply panning, attenuation and doppler.
FMOD_RESULT ChannelControl::set3DAttributes(
const FMOD_VECTOR *pos,
const FMOD_VECTOR *vel
);
FMOD_RESULT FMOD_Channel_Set3DAttributes(
FMOD_CHANNEL *channel,
const FMOD_VECTOR *pos,
const FMOD_VECTOR *vel
);
FMOD_RESULT FMOD_ChannelGroup_Set3DAttributes(
FMOD_CHANNELGROUP *channelgroup,
const FMOD_VECTOR *pos,
const FMOD_VECTOR *vel
);
RESULT ChannelControl.set3DAttributes(
ref VECTOR pos,
ref VECTOR vel
);
RESULT ChannelControl.set3DAttributes(
ref VECTOR pos,
ref VECTOR vel
);
Channel.set3DAttributes(
pos,
vel
);
ChannelGroup.set3DAttributes(
pos,
vel
);
Position in 3D space used for panning and attenuation. (FMOD_VECTOR)
Velocity in 3D space used for doppler. (FMOD_VECTOR)
The FMOD_3D flag must be set on this object otherwise FMOD_ERR_NEEDS3D is returned.
Vectors must be provided in the correct handedness.
For a stereo 3D sound, you can set the spread of the left/right parts in speaker space by using ChannelControl::set3DSpread.
See Also: ChannelControl::get3DAttributes
Sets the orientation of a 3D cone shape, used for simulated occlusion.
FMOD_RESULT ChannelControl::set3DConeOrientation(
FMOD_VECTOR *orientation
);
FMOD_RESULT FMOD_Channel_Set3DConeOrientation(
FMOD_CHANNEL *channel,
FMOD_VECTOR *orientation
);
FMOD_RESULT FMOD_ChannelGroup_Set3DConeOrientation(
FMOD_CHANNELGROUP *channelgroup,
FMOD_VECTOR *orientation
);
RESULT ChannelControl.set3DConeOrientation(
ref VECTOR orientation
);
Channel.set3DConeOrientation(
orientation
);
ChannelGroup.set3DConeOrientation(
orientation
);
Normalized orientation vector, which represents the direction of the sound cone. (FMOD_VECTOR)
The FMOD_3D flag must be set on this object otherwise FMOD_ERR_NEEDS3D is returned.
This function has no effect unless ChannelControl::set3DConeSettings has been used to change the cone inside/outside angles from the default.
Vectors must be provided in the correct handedness.
See Also: ChannelControl::get3DConeOrientation
Sets the angles and attenuation levels of a 3D cone shape, for simulated occlusion which is based on direction.
FMOD_RESULT ChannelControl::set3DConeSettings(
float insideconeangle,
float outsideconeangle,
float outsidevolume
);
FMOD_RESULT FMOD_Channel_Set3DConeSettings(
FMOD_CHANNEL *channel,
float insideconeangle,
float outsideconeangle,
float outsidevolume
);
FMOD_RESULT FMOD_ChannelGroup_Set3DConeSettings(
FMOD_CHANNELGROUP *channelgroup,
float insideconeangle,
float outsideconeangle,
float outsidevolume
);
RESULT ChannelControl.set3DConeSettings(
float insideconeangle,
float outsideconeangle,
float outsidevolume
);
Channel.set3DConeSettings(
insideconeangle,
outsideconeangle,
outsidevolume
);
ChannelGroup.set3DConeSettings(
insideconeangle,
outsideconeangle,
outsidevolume
);
Inside cone angle. This is the angle spread within which the sound is unattenuated.
outsideconeangle
]Outside cone angle. This is the angle spread outside of which the sound is attenuated to its outsidevolume
.
insideconeangle
, 360]Cone outside volume.
The FMOD_3D flag must be set on this object otherwise FMOD_ERR_NEEDS3D is returned.
When ChannelControl::set3DConeOrientation is used and a 3D 'cone' is set up, attenuation will automatically occur for a sound based on the relative angle of the direction the cone is facing, vs the angle between the sound and the listener.
insideconeangle
, the sound will not have any attenuation applied.insideconeangle
and outsideconeangle
, linear volume attenuation (between 1 and outsidevolume
) is applied between the two angles until it reaches the outsideconeangle
.outsideconeangle
the volume does not attenuate any further.See Also: ChannelControl::get3DConeSettings, Sound::set3DConeSettings
Sets a custom roll-off shape for 3D distance attenuation.
FMOD_RESULT ChannelControl::set3DCustomRolloff(
FMOD_VECTOR *points,
int numpoints
);
FMOD_RESULT FMOD_Channel_Set3DCustomRolloff(
FMOD_CHANNEL *channel,
FMOD_VECTOR *points,
int numpoints
);
FMOD_RESULT FMOD_ChannelGroup_Set3DCustomRolloff(
FMOD_CHANNELGROUP *channelgroup,
FMOD_VECTOR *points,
int numpoints
);
RESULT ChannelControl.set3DCustomRolloff(
ref VECTOR points,
int numpoints
);
Channel.set3DCustomRolloff(
points,
numpoints
);
ChannelGroup.set3DCustomRolloff(
points,
numpoints
);
Array of vectors sorted by distance, where x
= distance and y
= volume from 0 to 1. z
should be set to 0. Pass null or equivalen to disable custom rolloff. (FMOD_VECTOR)
points
.Must be used in conjunction with FMOD_3D_CUSTOMROLLOFF flag to be activated.
This function does not duplicate the memory for the points internally. The memory you pass to FMOD must remain valid while in use.
If FMOD_3D_CUSTOMROLLOFF is set and the roll-off shape is not set, FMOD will revert to FMOD_3D_INVERSEROLLOFF roll-off mode.
When a custom roll-off is specified a Channel or ChannelGroup's 3D 'minimum' and 'maximum' distances are ignored.
The distance in-between point values is linearly interpolated until the final point where the last value is held.
If the points are not sorted by distance, an error will result.
// Defining a custom array of points
FMOD_VECTOR curve[3] =
{
{ 0.0f, 1.0f, 0.0f },
{ 2.0f, 0.2f, 0.0f },
{ 20.0f, 0.0f, 0.0f }
};
See Also: Sound::set3DCustomRolloff, ChannelControl::get3DCustomRolloff
Sets an override value for the 3D distance filter.
If distance filtering is enabled, by default the 3D engine will automatically attenuate frequencies using a lowpass and a highpass filter, based on 3D distance.
This function allows the distance filter effect to be set manually, or to be set back to 'automatic' mode.
FMOD_RESULT ChannelControl::set3DDistanceFilter(
bool custom,
float customLevel,
float centerFreq
);
FMOD_RESULT FMOD_Channel_Set3DDistanceFilter(
FMOD_CHANNEL *channel,
FMOD_BOOL custom,
float customLevel,
float centerFreq
);
FMOD_RESULT FMOD_ChannelGroup_Set3DDistanceFilter(
FMOD_CHANNELGROUP *channelgroup,
FMOD_BOOL custom,
float customLevel,
float centerFreq
);
RESULT ChannelControl.set3DDistanceFilter(
bool custom,
float customLevel,
float centerFreq
);
Channel.set3DDistanceFilter(
custom,
customLevel,
centerFreq
);
ChannelGroup.set3DDistanceFilter(
custom,
customLevel,
centerFreq
);
Override automatic distance filtering and use customLevel
instead.
Attenuation factor where 1 represents no attenuation and 0 represents complete attenuation.
Center frequency of the band-pass filter used to simulate distance attenuation, 0 for default.
The FMOD_3D flag must be set on this object otherwise FMOD_ERR_NEEDS3D is returned.
The System must be initialized with FMOD_INIT_CHANNEL_DISTANCEFILTER for this feature to work.
Currently only supported for Channel, not ChannelGroup.
See Also: ChannelControl::get3DDistanceFilter
Sets the amount by which doppler is scaled.
FMOD_RESULT ChannelControl::set3DDopplerLevel(
float level
);
FMOD_RESULT FMOD_Channel_Set3DDopplerLevel(
FMOD_CHANNEL *channel,
float level
);
FMOD_RESULT FMOD_ChannelGroup_Set3DDopplerLevel(
FMOD_CHANNELGROUP *channelgroup,
float level
);
RESULT ChannelControl.set3DDopplerLevel(
float level
);
Channel.set3DDopplerLevel(
level
);
ChannelGroup.set3DDopplerLevel(
level
);
Doppler scale where 0 represents no doppler, 1 represents natural doppler and 5 represents exaggerated doppler.
The FMOD_3D flag must be set on this object otherwise FMOD_ERR_NEEDS3D is returned.
The doppler effect will disabled if System::set3DNumListeners is given a value greater than 1.
Currently only supported for Channel, not ChannelGroup.
See Also: ChannelControl::get3DDopplerLevel, System::set3DSettings
Sets the blend between 3D panning and 2D panning.
FMOD_RESULT ChannelControl::set3DLevel(
float level
);
FMOD_RESULT FMOD_Channel_Set3DLevel(
FMOD_CHANNEL *channel,
float level
);
FMOD_RESULT FMOD_ChannelGroup_Set3DLevel(
FMOD_CHANNELGROUP *channelgroup,
float level
);
RESULT ChannelControl.set3DLevel(
float level
);
Channel.set3DLevel(
level
);
ChannelGroup.set3DLevel(
level
);
3D pan level where 0 represents panning/attenuating solely with 2D panning functions and 1 represents solely 3D.
The FMOD_3D flag must be set on this object otherwise FMOD_ERR_NEEDS3D is returned.
2D functions include:
3D functions include:
See Also: ChannelControl::get3DLevel
Sets the minimum and maximum distances used to calculate the 3D roll-off attenuation.
FMOD_RESULT ChannelControl::set3DMinMaxDistance(
float mindistance,
float maxdistance
);
FMOD_RESULT FMOD_Channel_Set3DMinMaxDistance(
FMOD_CHANNEL *channel,
float mindistance,
float maxdistance
);
FMOD_RESULT FMOD_ChannelGroup_Set3DMinMaxDistance(
FMOD_CHANNELGROUP *channelgroup,
float mindistance,
float maxdistance
);
RESULT ChannelControl.set3DMinMaxDistance(
float mindistance,
float maxdistance
);
Channel.set3DMinMaxDistance(
mindistance,
maxdistance
);
ChannelGroup.set3DMinMaxDistance(
mindistance,
maxdistance
);
Distance from the source where attenuation begins.
maxdistance
]Distance from the source where attenuation ends.
mindistance
, inf)When the listener is within the minimum distance of the sound source the 3D volume will be at its maximum. As the listener moves from the minimum distance to the maximum distance the sound will attenuate following the roll-off curve set. When outside the maximum distance the sound will no longer attenuate.
Attenuation in 3D space is controlled by the roll-off mode, these are FMOD_3D_INVERSEROLLOFF, FMOD_3D_LINEARROLLOFF, FMOD_3D_LINEARSQUAREROLLOFF, FMOD_3D_INVERSETAPEREDROLLOFF, FMOD_3D_CUSTOMROLLOFF.
Minimum distance is useful to give the impression that the sound is loud or soft in 3D space.
A sound with a small 3D minimum distance in a typical (non custom) roll-off mode will make the sound appear small, and the sound will attenuate quickly.
A sound with a large minimum distance will make the sound appear larger.
The FMOD_3D flag must be set on this object otherwise FMOD_ERR_NEEDS3D is returned.
To define the min and max distance per Sound instead of Channel or ChannelGroup use Sound::set3DMinMaxDistance.
If FMOD_3D_CUSTOMROLLOFF has been set on this object these values are stored, but ignored in 3D processing.
See Also: ChannelControl::get3DMinMaxDistance
Sets the 3D attenuation factors for the direct and reverb paths.
FMOD_RESULT ChannelControl::set3DOcclusion(
float directocclusion,
float reverbocclusion
);
FMOD_RESULT FMOD_Channel_Set3DOcclusion(
FMOD_CHANNEL *channel,
float directocclusion,
float reverbocclusion
);
FMOD_RESULT FMOD_ChannelGroup_Set3DOcclusion(
FMOD_CHANNELGROUP *channelgroup,
float directocclusion,
float reverbocclusion
);
RESULT ChannelControl.set3DOcclusion(
float directocclusion,
float reverbocclusion
);
Channel.set3DOcclusion(
directocclusion,
reverbocclusion
);
ChannelGroup.set3DOcclusion(
directocclusion,
reverbocclusion
);
Occlusion factor for the direct path where 0 represents no occlusion and 1 represents full occlusion.
Occlusion factor for the reverb path where 0 represents no occlusion and 1 represents full occlusion.
There is a reverb path/send when ChannelControl::setReverbProperties has been used, reverbocclusion
controls its attenuation.
If the System has been initialized with FMOD_INIT_CHANNEL_DISTANCEFILTER or FMOD_INIT_CHANNEL_LOWPASS the directocclusion
is applied as frequency filtering rather than volume attenuation.
See Also: ChannelControl::get3DOcclusion
Sets the spread of a 3D sound in speaker space.
FMOD_RESULT ChannelControl::set3DSpread(
float angle
);
FMOD_RESULT FMOD_Channel_Set3DSpread(
FMOD_CHANNEL *channel,
float angle
);
FMOD_RESULT FMOD_ChannelGroup_Set3DSpread(
FMOD_CHANNELGROUP *channelgroup,
float angle
);
RESULT ChannelControl.set3DSpread(
float angle
);
Channel.set3DSpread(
angle
);
ChannelGroup.set3DSpread(
angle
);
Angle over which the sound is spread.
When the spread angle is 0 (default) a multi-channel signal will collapse to mono and be spatialized to a single point based on ChannelControl::set3DAttributes calculations. As the angle is increased, each channel within a multi-channel signal will be rotated away from that point. For 2, 4, 6, 8, and 12 channel signals, the spread is arranged from leftmost speaker to rightmost speaker intelligently, for example in 5.1 the leftmost speaker is rear left, followed by front left, center, front right then finally rear right as the rightmost speaker (LFE is not spread). For other channel counts the individual channels are spread evenly in the order of the signal. As the signal is spread the power will be preserved.
For a stereo signal given different spread angles:
See Also: ChannelControl::get3DSpread
Sets the callback for ChannelControl level notifications.
FMOD_RESULT ChannelControl::setCallback(
FMOD_CHANNELCONTROL_CALLBACK callback
);
FMOD_RESULT FMOD_Channel_SetCallback(
FMOD_CHANNEL *channel,
FMOD_CHANNELCONTROL_CALLBACK callback
);
FMOD_RESULT FMOD_ChannelGroup_SetCallback(
FMOD_CHANNELGROUP *channelgroup,
FMOD_CHANNELCONTROL_CALLBACK callback
);
RESULT ChannelControl.setCallback(
CHANNEL_CALLBACK callback
);
Channel.setCallback(
callback
);
ChannelGroup.setCallback(
callback
);
See Also: Callback Behavior, FMOD_CHANNELCONTROL_CALLBACK_TYPE
Sets a sample accurate start (and/or stop) time relative to the parent ChannelGroup DSP clock.
FMOD_RESULT ChannelControl::setDelay(
unsigned long long dspclock_start,
unsigned long long dspclock_end,
bool stopchannels = true
);
FMOD_RESULT FMOD_Channel_SetDelay(
FMOD_CHANNEL *channel,
unsigned long long dspclock_start,
unsigned long long dspclock_end,
FMOD_BOOL stopchannels
);
FMOD_RESULT FMOD_ChannelGroup_SetDelay(
FMOD_CHANNELGROUP *channelgroup,
unsigned long long dspclock_start,
unsigned long long dspclock_end,
FMOD_BOOL stopchannels
);
RESULT ChannelControl.setDelay(
ulong dspclock_start,
ulong dspclock_end,
bool stopchannels = true
);
Channel.setDelay(
dspclock_start,
dspclock_end,
stopchannels
);
ChannelGroup.setDelay(
dspclock_start,
dspclock_end,
stopchannels
);
DSP clock of the parent ChannelGroup to audibly start playing sound at.
DSP clock of the parent ChannelGroup to audibly stop playing sound at.
True: When dspclock_end
is reached, behaves like ChannelControl::stop has been called.
False: When dspclock_end
is reached, behaves like ChannelControl::setPaused has been called, a subsequent dspclock_start
allows it to resume.
To perform sample accurate scheduling use ChannelControl::getDSPClock to query the parent clock value. If a parent ChannelGroup changes its pitch, the start and stop times will still be correct as the parent clock rate is adjusted by that pitch.
See Also: ChannelControl::getDelay
Sets the index in the DSP chain of the specified DSP.
FMOD_RESULT ChannelControl::setDSPIndex(
DSP *dsp,
int index
);
FMOD_RESULT FMOD_Channel_SetDSPIndex(
FMOD_CHANNEL *channel,
FMOD_DSP *dsp,
int index
);
FMOD_RESULT FMOD_ChannelGroup_SetDSPIndex(
FMOD_CHANNELGROUP *channelgroup,
FMOD_DSP *dsp,
int index
);
RESULT ChannelControl.setDSPIndex(
DSP dsp,
int index
);
Channel.setDSPIndex(
dsp,
index
);
ChannelGroup.setDSPIndex(
dsp,
index
);
This will move a DSP already in the DSP chain to a new offset.
See Also: ChannelControl::getDSPIndex
Adds a volume ramp at the specified time in the future using fade points.
FMOD_RESULT ChannelControl::setFadePointRamp(
unsigned long long dspclock,
float volume
);
FMOD_RESULT FMOD_Channel_SetFadePointRamp(
FMOD_CHANNEL *channel,
unsigned long long dspclock,
float volume
);
FMOD_RESULT FMOD_ChannelGroup_SetFadePointRamp(
FMOD_CHANNELGROUP *channelgroup,
unsigned long long dspclock,
float volume
);
RESULT ChannelControl.setFadePointRamp(
ulong dspclock,
float volume
);
Channel.setFadePointRamp(
dspclock,
volume
);
ChannelGroup.setFadePointRamp(
dspclock,
volume
);
Time at which the ramp will end, as measured by the DSP clock of the parent ChannelGroup.
Volume level at the given dspclock
. 0 = silent, 1 = full.
This is a convenience function that creates a scheduled 64 sample fade point ramp from the current volume level to volume
arriving at dspclock
time.
Can be use in conjunction with ChannelControl::SetDelay.
All fade points after dspclock
will be removed.
See Also: ChannelControl::removeFadePoints, ChannelControl::addFadePoint, ChannelControl::getFadePoints
Sets the gain of the dry signal when built in lowpass / distance filtering is applied.
FMOD_RESULT ChannelControl::setLowPassGain(
float gain
);
FMOD_RESULT FMOD_Channel_SetLowPassGain(
FMOD_CHANNEL *channel,
float gain
);
FMOD_RESULT FMOD_ChannelGroup_SetLowPassGain(
FMOD_CHANNELGROUP *channelgroup,
float gain
);
RESULT ChannelControl.setLowPassGain(
float gain
);
Channel.setLowPassGain(
gain
);
ChannelGroup.setLowPassGain(
gain
);
gain level where 0 represents silent (full filtering) and 1 represents full volume (no filtering).
Requires the built in lowpass to be created with FMOD_INIT_CHANNEL_LOWPASS or FMOD_INIT_CHANNEL_DISTANCEFILTER.
Currently only supported for Channel, not ChannelGroup.
See Also: ChannelControl::getLowPassGain
Sets the incoming volume level for each channel of a multi-channel signal.
FMOD_RESULT ChannelControl::setMixLevelsInput(
float *levels,
int numlevels
);
FMOD_RESULT FMOD_Channel_SetMixLevelsInput(
FMOD_CHANNEL *channel,
float *levels,
int numlevels
);
FMOD_RESULT FMOD_ChannelGroup_SetMixLevelsInput(
FMOD_CHANNELGROUP *channelgroup,
float *levels,
int numlevels
);
RESULT ChannelControl.setMixLevelsInput(
float[] levels,
int numlevels
);
Channel.setMixLevelsInput(
levels,
numlevels
);
ChannelGroup.setMixLevelsInput(
levels,
numlevels
);
Array of volume levels for each incoming channel. Volume level. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Number of levels in the array.
This is a convenience function to avoid passing a matrix, it will overwrite values set via ChannelControl::setPan, ChannelControl::setMixLevelsOutput and ChannelControl::setMixMatrix.
Currently only supported for Channel, not ChannelGroup.
See Also: ChannelControl::getMixMatrix
Sets the outgoing volume levels for each speaker.
FMOD_RESULT ChannelControl::setMixLevelsOutput(
float frontleft,
float frontright,
float center,
float lfe,
float surroundleft,
float surroundright,
float backleft,
float backright
);
FMOD_RESULT FMOD_Channel_SetMixLevelsOutput(
FMOD_CHANNEL *channel,
float frontleft,
float frontright,
float center,
float lfe,
float surroundleft,
float surroundright,
float backleft,
float backright
);
FMOD_RESULT FMOD_ChannelGroup_SetMixLevelsOutput(
FMOD_CHANNELGROUP *channelgroup,
float frontleft,
float frontright,
float center,
float lfe,
float surroundleft,
float surroundright,
float backleft,
float backright
);
RESULT ChannelControl.setMixLevelsOutput(
float frontleft,
float frontright,
float center,
float lfe,
float surroundleft,
float surroundright,
float backleft,
float backright
);
Channel.setMixLevelsOutput(
frontleft,
frontright,
center,
lfe,
surroundleft,
surroundright,
backleft,
backright
);
ChannelGroup.setMixLevelsOutput(
frontleft,
frontright,
center,
lfe,
surroundleft,
surroundright,
backleft,
backright
);
Volume level for FMOD_SPEAKER_FRONT_LEFT. Volume level. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Volume level for FMOD_SPEAKER_FRONT_RIGHT. Volume level. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Volume level for FMOD_SPEAKER_FRONT_CENTER. Volume level. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Volume level for FMOD_SPEAKER_LOW_FREQUENCY. Volume level. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Volume level for FMOD_SPEAKER_SURROUND_LEFT. Volume level. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Volume level for FMOD_SPEAKER_SURROUND_RIGHT. Volume level. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Volume level for FMOD_SPEAKER_BACK_LEFT. Volume level. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Volume level for FMOD_SPEAKER_BACK_RIGHT. Volume level. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
Specify the level for a given output speaker, if the channel count of the input and output do not match, channels will be up/down mixed as appropriate to approximate the given speaker values. For example stereo input with 5.1 output will use the center
parameter to distribute signal to the center speaker from front left and front right channels.
This is a convenience function to avoid passing a matrix, it will overwrite values set via ChannelControl::setPan, ChannelControl::setMixLevelsInput and ChannelControl::setMixMatrix.
The output channel count will always match the System speaker mode set via System::setSoftwareFormat.
If the System is initialized with FMOD_SPEAKERMODE_RAW calling this function will produce silence.
See Also: ChannelControl::getMixMatrix
Sets a two-dimensional pan matrix that maps the signal from input channels (columns) to output speakers (rows).
FMOD_RESULT ChannelControl::setMixMatrix(
float *matrix,
int outchannels,
int inchannels,
int inchannel_hop = 0
);
FMOD_RESULT FMOD_Channel_SetMixMatrix(
FMOD_CHANNEL *channel,
float *matrix,
int outchannels,
int inchannels,
int inchannel_hop
);
FMOD_RESULT FMOD_ChannelGroup_SetMixMatrix(
FMOD_CHANNELGROUP *channelgroup,
float *matrix,
int outchannels,
int inchannels,
int inchannel_hop
);
RESULT ChannelControl.setMixMatrix(
float[] matrix,
int outchannels,
int inchannels,
int inchannel_hop = 0
);
Channel.setMixMatrix(
matrix,
outchannels,
inchannels,
inchannel_hop
);
ChannelGroup.setMixMatrix(
matrix,
outchannels,
inchannels,
inchannel_hop
);
Two dimensional array of volume levels in row-major order. Each row represents an output speaker, each column represents an input channel.
Number of output channels (rows) in matrix
.
Number of input channels (columns) in matrix
.
matrix
. A matrix element is referenced as 'outchannel * inchannel_hop + inchannel'.inchannels
This will overwrite values set via ChannelControl::setPan, ChannelControl::setMixLevelsInput and ChannelControl::setMixLevelsOutput.
If no matrix is passed in via matrix
a default upmix, downmix, or unit matrix will take its place. A unit matrix allows a signal to pass through unchanged.
Example 5.1 unit matrix:
1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 1 0
0 0 0 0 0 1
Matrix element values can be below 0 to invert a signal and above 1 to amplify the signal. Note that increasing the signal level too far may cause audible distortion.
See Also: ChannelControl::getMixMatrix
Sets the playback mode that controls how this object behaves.
FMOD_RESULT ChannelControl::setMode(
FMOD_MODE mode
);
FMOD_RESULT FMOD_Channel_SetMode(
FMOD_CHANNEL *channel,
FMOD_MODE mode
);
FMOD_RESULT FMOD_ChannelGroup_SetMode(
FMOD_CHANNELGROUP *channelgroup,
FMOD_MODE mode
);
RESULT ChannelControl.setMode(
MODE mode
);
Channel.setMode(
mode
);
ChannelGroup.setMode(
mode
);
Playback mode. More than one mode can be set at once by combining them with the OR operator. (FMOD_MODE)
Modes supported:
When changing the loop mode, sounds created with System::createStream or FMOD_CREATESTREAM may have already been pre-buffered and executed their loop logic ahead of time before this call was even made. This is dependent on the size of the sound versus the size of the stream decode buffer (see FMOD_CREATESOUNDEXINFO). If this happens, you may need to reflush the stream buffer by calling Channel::setPosition. Note this will usually only happen if you have sounds or loop points that are smaller than the stream decode buffer size.
When changing the loop mode of sounds created with with System::createSound or FMOD_CREATESAMPLE, if the sound was set up as FMOD_LOOP_OFF, then set to FMOD_LOOP_NORMAL with this function, the sound may click when playing the end of the sound. This is because the sound needs to be prepared for looping using Sound::setMode, by modifying the content of the PCM data (i.e. data past the end of the actual sample data) to allow the interpolators to read ahead without clicking. If you use ChannelControl::setMode it will not do this (because different Channels may have different loop modes for the same sound) and may click if you try to set it to looping on an unprepared sound. If you want to change the loop mode at runtime it may be better to load the sound as looping first (or use Sound::setMode), to let it prepare the data as if it was looping so that it does not click whenever ChannelControl::setMode is used to turn looping on.
If FMOD_3D_IGNOREGEOMETRY or FMOD_VIRTUAL_PLAYFROMSTART is not specified, the flag will be cleared if it was specified previously.
See Also: ChannelControl::getMode
Sets the mute state.
FMOD_RESULT ChannelControl::setMute(
bool mute
);
FMOD_RESULT FMOD_Channel_SetMute(
FMOD_CHANNEL *channel,
FMOD_BOOL mute
);
FMOD_RESULT FMOD_ChannelGroup_SetMute(
FMOD_CHANNELGROUP *channelgroup,
FMOD_BOOL mute
);
RESULT ChannelControl.setMute(
bool mute
);
Channel.setMute(
mute
);
ChannelGroup.setMute(
mute
);
Mute state. True = silent. False = audible.
Mute is an additional control for volume, the effect of which is equivalent to setting the volume to zero.
An individual mute state is kept for each object, muting a parent ChannelGroup will effectively mute this object however when queried the individual mute state is returned. ChannelControl::getAudibility can be used to calculate overall audibility for a Channel or ChannelGroup.
See Also: ChannelControl::getMute
Sets the left/right pan level.
FMOD_RESULT ChannelControl::setPan(
float pan
);
FMOD_RESULT FMOD_Channel_SetPan(
FMOD_CHANNEL *channel,
float pan
);
FMOD_RESULT FMOD_ChannelGroup_SetPan(
FMOD_CHANNELGROUP *channelgroup,
float pan
);
RESULT ChannelControl.setPan(
float pan
);
Channel.setPan(
pan
);
ChannelGroup.setPan(
pan
);
Pan level where -1 represents full left, 0 represents center and 1 represents full right.
This is a convenience function to avoid passing a matrix, it will overwrite values set via ChannelControl::setMixLevelsInput, ChannelControl::setMixLevelsOutput and ChannelControl::setMixMatrix.
Mono inputs are panned from left to right using constant power panning (non linear fade). Stereo and greater inputs will isolate the front left and right input channels and fade them up and down based on the pan value (silencing other channels). The output channel count will always match the System speaker mode set via System::setSoftwareFormat.
If the System is initialized with FMOD_SPEAKERMODE_RAW calling this function will produce silence.
See Also: ChannelControl::getMixMatrix
Sets the paused state.
FMOD_RESULT ChannelControl::setPaused(
bool paused
);
FMOD_RESULT FMOD_Channel_SetPaused(
FMOD_CHANNEL *channel,
FMOD_BOOL paused
);
FMOD_RESULT FMOD_ChannelGroup_SetPaused(
FMOD_CHANNELGROUP *channelgroup,
FMOD_BOOL paused
);
RESULT ChannelControl.setPaused(
bool paused
);
Channel.setPaused(
paused
);
ChannelGroup.setPaused(
paused
);
Paused state. True = playback halted. False = playback active.
Pause halts playback which effectively freezes Channel::getPosition and ChannelControl::getDSPClock values.
An individual pause state is kept for each object, pausing a parent ChannelGroup will effectively pause this object however when queried the individual pause state is returned.
See Also: ChannelControl::getPaused
Sets the relative pitch / playback rate.
FMOD_RESULT ChannelControl::setPitch(
float pitch
);
FMOD_RESULT FMOD_Channel_SetPitch(
FMOD_CHANNEL *channel,
float pitch
);
FMOD_RESULT FMOD_ChannelGroup_SetPitch(
FMOD_CHANNELGROUP *channelgroup,
float pitch
);
RESULT ChannelControl.setPitch(
float pitch
);
Channel.setPitch(
pitch
);
ChannelGroup.setPitch(
pitch
);
Scales playback frequency of Channel object or if issued on a ChannelGroup it scales the frequencies of all Channels contained in the ChannelGroup.
An individual pitch value is kept for each object, changing the pitch of a parent ChannelGroup will effectively alter the pitch of this object however when queried the individual pitch value is returned.
See Also: ChannelControl::getPitch, Channel::setFrequency, Channel::getFrequency
Sets the wet / send level for a particular reverb instance.
FMOD_RESULT ChannelControl::setReverbProperties(
int instance,
float wet
);
FMOD_RESULT FMOD_Channel_SetReverbProperties(
FMOD_CHANNEL *channel,
int instance,
float wet
);
FMOD_RESULT FMOD_ChannelGroup_SetReverbProperties(
FMOD_CHANNELGROUP *channelgroup,
int instance,
float wet
);
RESULT ChannelControl.setReverbProperties(
int instance,
float wet
);
Channel.setReverbProperties(
instance,
wet
);
ChannelGroup.setReverbProperties(
instance,
wet
);
Reverb instance index.
Send level for the signal to the reverb. 0 = none, 1 = full. Negative level inverts the signal.
Channels are automatically connected to all existing reverb instances due to the default wet level of 1. ChannelGroups however will not send to any reverb by default requiring an explicit call to this function.
ChannelGroup reverb is optimal for the case where you want to send 1 mixed signal to the reverb, rather than a lot of individual Channel reverb sends. It is advisable to do this to reduce CPU if you have many Channels inside a ChannelGroup.
When setting a wet level for a ChannelGroup, any Channels under that ChannelGroup will still have their existing sends to the reverb. To avoid this doubling up you should explicitly set the Channel wet levels to 0.
See Also: ChannelControl::getReverbProperties
Sets a user value associated with this object.
FMOD_RESULT ChannelControl::setUserData(
void *userdata
);
FMOD_RESULT FMOD_Channel_SetUserData(
FMOD_CHANNEL *channel,
void *userdata
);
FMOD_RESULT FMOD_ChannelGroup_SetUserData(
FMOD_CHANNELGROUP *channelgroup,
void *userdata
);
RESULT ChannelControl.setUserData(
IntPtr userdata
);
Channel.setUserData(
userdata
);
ChannelGroup.setUserData(
userdata
);
This function allows arbitrary user data to be attached to this object. See the User Data section of the glossary for an example of how to get and set user data.
See Also: ChannelControl::getUserData, ChannelControl::setCallback
Sets the volume level.
FMOD_RESULT ChannelControl::setVolume(
float volume
);
FMOD_RESULT FMOD_Channel_SetVolume(
FMOD_CHANNEL *channel,
float volume
);
FMOD_RESULT FMOD_ChannelGroup_SetVolume(
FMOD_CHANNELGROUP *channelgroup,
float volume
);
RESULT ChannelControl.setVolume(
float volume
);
Channel.setVolume(
volume
);
ChannelGroup.setVolume(
volume
);
Volume level. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.
To define the volume per Sound use Sound::setDefaults.
Setting volume
at a level higher than 1 can lead to distortion/clipping.
See Also: ChannelControl::getVolume
Sets whether volume changes are ramped or instantaneous.
FMOD_RESULT ChannelControl::setVolumeRamp(
bool ramp
);
FMOD_RESULT FMOD_Channel_SetVolumeRamp(
FMOD_CHANNEL *channel,
FMOD_BOOL ramp
);
FMOD_RESULT FMOD_ChannelGroup_SetVolumeRamp(
FMOD_CHANNELGROUP *channelgroup,
FMOD_BOOL ramp
);
RESULT ChannelControl.setVolumeRamp(
bool ramp
);
Channel.setVolumeRamp(
ramp
);
ChannelGroup.setVolumeRamp(
ramp
);
Ramp state. True = volume change is ramped. False = volume change is instantaeous.
Volume changes when not paused will be ramped to the target value to avoid a pop sound, this function allows that setting to be overridden and volume changes to be applied immediately.
See Also: ChannelControl::getVolumeRamp
Stops the Channel (or all Channels in nested ChannelGroups) from playing.
FMOD_RESULT ChannelControl::stop();
FMOD_RESULT FMOD_Channel_Stop(FMOD_CHANNEL *channel);
FMOD_RESULT FMOD_ChannelGroup_Stop(FMOD_CHANNELGROUP *channelgroup);
RESULT ChannelControl.stop();
Channel.stop();
ChannelGroup.stop();
This will free up internal resources for reuse by the virtual voice system.
Channels are stopped automatically when their playback position reaches the length of the Sound being played. This is not the case however if the Channel is playing a DSP or the Sound is looping, in which case the Channel will continue playing until stop is called. Once stopped, the Channel handle will become invalid and can be discarded and any API calls made with it will return FMOD_ERR_INVALID_HANDLE.
See Also: System::playSound, Channel::getPosition, Sound::getLength, System::playDSP
Identifier used to distinguish between Channel and ChannelGroup in the ChannelControl callback.
typedef enum FMOD_CHANNELCONTROL_TYPE {
FMOD_CHANNELCONTROL_CHANNEL,
FMOD_CHANNELCONTROL_CHANNELGROUP,
FMOD_CHANNELCONTROL_MAX,
} FMOD_CHANNELCONTROL_TYPE;
enum CHANNELCONTROL_TYPE : int
{
CHANNEL,
CHANNELGROUP,
MAX
}
CHANNELCONTROL_CHANNEL
CHANNELCONTROL_CHANNELGROUP
CHANNELCONTROL_MAX
See Also: ChannelControl::setCallback