FMOD Engine User Manual 2.03

7. Core API Reference | DSP

A digital signal processor is one node within a graph that transforms input audio signals into an output stream.

Create with System::createDSP, System::createDSPByType or System::createDSPByPlugin.

Connections:

Parameters:

Channel format:

Metering:

Processing:

General:


DSP::addInput

Adds a DSP unit as an input to this object.

C
C++
C#
JS

FMOD_RESULT DSP::addInput(
  DSP *input,
  DSPConnection **connection = nullptr,
  FMOD_DSPCONNECTION_TYPE type = FMOD_DSPCONNECTION_TYPE_STANDARD
);
FMOD_RESULT FMOD_DSP_AddInput(
  FMOD_DSP *dsp,
  FMOD_DSP *input,
  FMOD_DSPCONNECTION **connection,
  FMOD_DSPCONNECTION_TYPE type
);
RESULT DSP.addInput(
  DSP input
);
RESULT DSP.addInput(
  DSP input,
  out DSPConnection connection,
  DSPCONNECTION_TYPE type = DSPCONNECTION_TYPE.STANDARD
);
DSP.addInput(
  input,
  connection,
  type
);
input
DSP unit to be added. (DSP)
connection OutOpt
Connection between the two units. (DSPConnection)
type

Type of connection between the two units. (FMOD_DSPCONNECTION_TYPE)

When a DSP has multiple inputs the signals are automatically mixed together, sent to the unit's output(s).

The returned connection will remain valid until the units are disconnected.

See Also: DSP::getInput, DSP::getNumInputs, DSP::getOutput, DSP::getNumOutputs

FMOD_DSP_CALLBACK

Callback for DSP notifications.

C
C++
C#
JS

FMOD_RESULT F_CALL FMOD_DSP_CALLBACK(
  FMOD_DSP *dsp,
  FMOD_DSP_CALLBACK_TYPE type,
  void *data
);
delegate RESULT DSP_CALLBACK(
  IntPtr dsp,
  DSP_CALLBACK_TYPE type,
  IntPtr data
);
function FMOD_DSP_CALLBACK(
  dsp,
  type,
  data
)
dsp
DSP handle. (DSP)
type
Type of callback. (FMOD_DSP_CALLBACK_TYPE)
data Opt
Callback data; see FMOD_DSP_CALLBACK_TYPE for details.

The 'dsp' argument can be cast to FMOD::DSP *.

You can convert the 'dsp' argument to an FMOD.DSP object by using FMOD.DSP dspobject = new FMOD.DSP(dsp);

See Also: Callback Behavior, DSP::setCallback

FMOD_DSP_CALLBACK_TYPE

Types of callback called by a DSP.

C
C++
C#
JS

typedef enum FMOD_DSP_CALLBACK_TYPE {
  FMOD_DSP_CALLBACK_DATAPARAMETERRELEASE,
  FMOD_DSP_CALLBACK_MAX
} FMOD_DSP_CALLBACK_TYPE;
enum DSP_CALLBACK_TYPE : int
{
  DATAPARAMETERRELEASE,
  MAX,
}
DSP_CALLBACK_DATAPARAMETERRELEASE
DSP_CALLBACK_MAX
FMOD_DSP_CALLBACK_DATAPARAMETERRELEASE
Called when a DSP's data parameter can be released.
data: FMOD_DSP_DATA_PARAMETER_INFO.

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, DSP::setCallback

FMOD_DSP_DATA_PARAMETER_INFO

Describes the value of a DSP's data parameter.

C
C++
C#
JS

typedef struct FMOD_DSP_DATA_PARAMETER_INFO {
  void          *data;
  unsigned int  length;
  int           index;
} FMOD_DSP_DATA_PARAMETER_INFO;
struct DSP_DATA_PARAMETER_INFO
{
    IntPtr          data;
    uint            length;
    int             index;
}
FMOD_DSP_DATA_PARAMETER_INFO
{
  data,
  length,
  index,
};
data
Pointer to the data buffer.
length
Length of the data buffer in bytes. (unsigned int)
index
Index of the DSP parameter. (int)

This data is passed to the DSP callback function when type is FMOD_DSP_CALLBACK_DATAPARAMETERRELEASE. The callback should free the data pointer if it is no longer required.

See Also: FMOD_DSP_CALLBACK

DSP::disconnectAll

Disconnects all inputs and/or outputs.

C
C++
C#
JS

FMOD_RESULT DSP::disconnectAll(
  bool inputs,
  bool outputs
);
FMOD_RESULT FMOD_DSP_DisconnectAll(
  FMOD_DSP *dsp,
  FMOD_BOOL inputs,
  FMOD_BOOL outputs
);
RESULT DSP.disconnectAll(
  bool inputs,
  bool outputs
);
DSP.disconnectAll(
  inputs,
  outputs
);
inputs

Whether all inputs should be disconnected.

  • Units: Boolean
outputs

Whether all outputs should be disconnected.

  • Units: Boolean

This is a convenience function that is faster than disconnecting all inputs and outputs individually.

See Also: DSP::disconnectFrom

DSP::disconnectFrom

Disconnect the specified input DSP.

C
C++
C#
JS

FMOD_RESULT DSP::disconnectFrom(
  DSP *target,
  DSPConnection *connection = nullptr
);
FMOD_RESULT FMOD_DSP_DisconnectFrom(
  FMOD_DSP *dsp,
  FMOD_DSP *target,
  FMOD_DSPCONNECTION *connection
);
RESULT DSP.disconnectFrom(
  DSP target,
  DSPConnection connection = null
);
DSP.disconnectFrom(
  target,
  connection
);
target Opt
Input DSP unit to disconnect. If an input DSP unit is not specified, all inputs and outputs are disconnected from this unit. (DSP)
connection Opt
When there is more than one connection between two units this can be used to define which of the connections should be disconnected. (DSPConnection)

If target had only one output, after this operation that entire sub graph will no longer be connected to the DSP graph.

After this operation connection is no longer valid.

See Also: DSP::addInput, DSP::disconnectAll

DSP::getActive

Retrieves the processing active state.

C
C++
C#
JS

FMOD_RESULT DSP::getActive(
  bool *active
);
FMOD_RESULT FMOD_DSP_GetActive(
  FMOD_DSP *dsp,
  FMOD_BOOL *active
);
RESULT DSP.getActive(
  out bool active
);
DSP.getActive(
  active
);
active Out

Active state.

  • Units: Boolean
  • Default: False

If active is False, processing of this unit and its inputs are stopped.

A DSP is inactive when first created. It is automatically activated when ChannelControl::addDSP is used; otherwise, it must be set to active manually.

See Also: DSP::setActive, DSP::setBypass

DSP::getBypass

Retrieves the processing bypass state.

C
C++
C#
JS

FMOD_RESULT DSP::getBypass(
  bool *bypass
);
FMOD_RESULT FMOD_DSP_GetBypass(
  FMOD_DSP *dsp,
  FMOD_BOOL *bypass
);
RESULT DSP.getBypass(
  out bool bypass
);
DSP.getBypass(
  bypass
);
bypass Out

Bypass state.

  • Units: Boolean
  • Default: False

If bypass is true, processing of this unit is skipped but it continues to process its inputs.

See Also: DSP::setBypass, DSP::setActive

DSP::getChannelFormat

Retrieves the PCM input format this DSP will receive when processing.

C
C++
C#
JS

FMOD_RESULT DSP::getChannelFormat(
  FMOD_CHANNELMASK *channelmask,
  int *numchannels,
  FMOD_SPEAKERMODE *source_speakermode
);
FMOD_RESULT FMOD_DSP_GetChannelFormat(
  FMOD_DSP *dsp,
  FMOD_CHANNELMASK *channelmask,
  int *numchannels,
  FMOD_SPEAKERMODE *source_speakermode
);
RESULT DSP.getChannelFormat(
  out CHANNELMASK channelmask,
  out int numchannels,
  out SPEAKERMODE source_speakermode
);
DSP.getChannelFormat(
  channelmask,
  numchannels,
  source_speakermode
);
channelmask OutOpt
Deprecated. (FMOD_CHANNELMASK)
numchannels OutOpt
Number of channels to be processed.
source_speakermode OutOpt
Speaker mode to describe the channel mapping. (FMOD_SPEAKERMODE)

See Also: DSP::setChannelFormat

DSP::getCPUUsage

Retrieves statistics on the mixer thread CPU usage for this unit.

C
C++
C#
JS

FMOD_RESULT DSP::getCPUUsage(
  unsigned int *exclusive,
  unsigned int *inclusive
);
FMOD_RESULT FMOD_DSP_GetCPUUsage(
  FMOD_DSP *dsp,
  unsigned int *exclusive,
  unsigned int *inclusive
);
RESULT DSP.getCPUUsage(
  out uint exclusive,
  out uint inclusive
);
DSP.getCPUUsage(
  exclusive,
  inclusive
);
exclusive OutOpt

CPU time spent processing just this unit during the last mixer update.

  • Units: Microseconds
inclusive OutOpt

CPU time spent processing this unit and all of its input during the last mixer update.

  • Units: Microseconds

FMOD_INIT_PROFILE_ENABLE with System::init is required to call this function.

DSP::getDataParameterIndex

Retrieve the index of the first data parameter of a particular data type.

C
C++
C#
JS

FMOD_RESULT DSP::getDataParameterIndex(
  int datatype,
  int *index
);
FMOD_RESULT FMOD_DSP_GetDataParameterIndex(
  FMOD_DSP *dsp,
  int datatype,
  int *index
);
RESULT DSP.getDataParameterIndex(
  int datatype,
  out int index
);
DSP.getDataParameterIndex(
  datatype,
  index
);
datatype
The type of data to find. Typically of type FMOD_DSP_PARAMETER_DATA_TYPE.
index OutOpt
Contains the index of the first data parameter of type datatype after the function is called. Will be -1 if no matches were found.

This function returns FMOD_OK if a parameter of matching type is found and FMOD_ERR_INVALID_PARAM if no matches were found.

The return code can be used to check whether the DSP supports specific functionality through data parameters of certain types without the need to provide index.

DSP::getIdle

Retrieves the idle state.

C
C++
C#
JS

FMOD_RESULT DSP::getIdle(
  bool *idle
);
FMOD_RESULT FMOD_DSP_GetIdle(
  FMOD_DSP *dsp,
  FMOD_BOOL *idle
);
RESULT DSP.getIdle(
  out bool idle
);
DSP.getIdle(
  idle
);
idle Out

Idle state.

  • Units: Boolean

A DSP is considered idle when it stops receiving input signals and all internal processing of stored input has been exhausted.

Different DSP types can have different idle behavior. A reverb or echo DSP may take longer to go idle after it stops receiving a valid signal than a DSP with a shorter tail length, such as an EQ filter.

DSP::getInfo

Retrieves information about this DSP unit.

C
C++
C#
JS

FMOD_RESULT DSP::getInfo(
  char *name,
  unsigned int *version,
  int *channels,
  int *configwidth,
  int *configheight
);
FMOD_RESULT FMOD_DSP_GetInfo(
  FMOD_DSP *dsp,
  char *name,
  unsigned int *version,
  int *channels,
  int *configwidth,
  int *configheight
);
RESULT DSP.getInfo(
  out string name,
  out uint version,
  out int channels,
  out int configwidth,
  out int configheight
);
DSP.getInfo(
  name,
  version,
  channels,
  configwidth,
  configheight
);
name OutOpt
The name of this unit will be written (null terminated) to the provided 32 byte buffer. (UTF-8 string)
version OutOpt
Version number of this unit, usually formatted as hex AAAABBBB where the AAAA is the major version number and the BBBB is the minor version number.
channels OutOpt
Number of channels this unit processes where 0 represents "any".
configwidth OutOpt
Configuration dialog box width where 0 represents "no dialog box".
configheight OutOpt
Configuration dialog box height where 0 represents "no dialog box".

See Also: DSP::showConfigDialog

DSP::getInput

Retrieves the DSP unit at the specified index in the input list.

C
C++
C#
JS

FMOD_RESULT DSP::getInput(
  int index,
  DSP **input,
  DSPConnection **inputconnection
);
FMOD_RESULT FMOD_DSP_GetInput(
  FMOD_DSP *dsp,
  int index,
  FMOD_DSP **input,
  FMOD_DSPCONNECTION **inputconnection
);
RESULT DSP.getInput(
  int index,
  out DSP input,
  out DSPConnection inputconnection
);
DSP.getInput(
  index,
  input,
  inputconnection
);
index

Offset into this DSP's input list.

input OutOpt
DSP unit at the specified index. (DSP)
inputconnection OutOpt
Connection between this unit and input. (DSPConnection)

This will flush the DSP queue (which blocks against the mixer) to ensure the input list is correct, avoid this during time sensitive operations.

The returned connection will remain valid until the units are disconnected.

See Also: DSP::addInput, DSP::getOutput

DSP::getMeteringEnabled

Retrieves the input and output signal metering enabled states.

C
C++
C#
JS

FMOD_RESULT DSP::getMeteringEnabled(
  bool *inputEnabled,
  bool *outputEnabled
);
FMOD_RESULT FMOD_DSP_GetMeteringEnabled(
  FMOD_DSP *dsp,
  FMOD_BOOL *inputEnabled,
  FMOD_BOOL *outputEnabled
);
RESULT DSP.getMeteringEnabled(
  out bool inputEnabled,
  out bool outputEnabled
);
DSP.getMeteringEnabled(
  inputEnabled,
  outputEnabled
);
inputEnabled OutOpt

Metering enabled state for the input signal.

  • Units: Boolean
  • Default: False
outputEnabled OutOpt

Metering enabled state for the output signal.

  • Units: Boolean
  • Default: False

Input metering is pre processing, while output metering is post processing.

Enabled metering allows DSP::getMeteringInfo to return metering information and allows FMOD profiling tools to visualize the levels.

FMOD_INIT_PROFILE_METER_ALL with System::init will automatically turn on metering for all DSP units inside the dsp graph.

See Also: DSP::setMeteringEnabled

DSP::getMeteringInfo

Retrieve the signal metering enabled metering information.

C
C++
C#
JS

FMOD_RESULT DSP::getMeteringInfo(
  FMOD_DSP_METERING_INFO *inputInfo,
  FMOD_DSP_METERING_INFO *outputInfo
);
FMOD_RESULT FMOD_DSP_GetMeteringInfo(
  FMOD_DSP *dsp,
  FMOD_DSP_METERING_INFO *inputInfo,
  FMOD_DSP_METERING_INFO *outputInfo
);
RESULT DSP.getMeteringInfo(
  IntPtr zero,
  DSP_METERING_INFO outputInfo
);
RESULT DSP.getMeteringInfo(
  DSP_METERING_INFO inputInfo,
  IntPtr zero
);
RESULT DSP.getMeteringInfo(
  DSP_METERING_INFO inputInfo,
  DSP_METERING_INFO outputInfo
);
DSP.getMeteringInfo(
  inputInfo,
  outputInfo
);
inputInfo OutOpt
Input metering information before the DSP has processed. (FMOD_DSP_METERING_INFO)
outputInfo OutOpt
Output metering information after the DSP has processed. (FMOD_DSP_METERING_INFO)

Requesting metering information when it hasn't been enabled will result in FMOD_ERR_BADCOMMAND.

FMOD_INIT_PROFILE_METER_ALL with System::init will automatically enable metering for all DSP units.

See Also: DSP::setMeteringEnabled, DSP::getMeteringEnabled

DSP::getNumInputs

Retrieves the number of DSP units in the input list.

C
C++
C#
JS

FMOD_RESULT DSP::getNumInputs(
  int *numinputs
);
FMOD_RESULT FMOD_DSP_GetNumInputs(
  FMOD_DSP *dsp,
  int *numinputs
);
RESULT DSP.getNumInputs(
  out int numinputs
);
DSP.getNumInputs(
  numinputs
);
numinputs Out
Number of input DSPs.

This flushes the DSP queue (which blocks against the mixer) to ensure the input list is correct. You should avoid doing this during time-sensitive operations.

See Also: DSP::getNumOutputs, DSP::getInput

DSP::getNumOutputs

Retrieves the number of DSP units in the output list.

C
C++
C#
JS

FMOD_RESULT DSP::getNumOutputs(
  int *numoutputs
);
FMOD_RESULT FMOD_DSP_GetNumOutputs(
  FMOD_DSP *dsp,
  int *numoutputs
);
RESULT DSP.getNumOutputs(
  out int numoutputs
);
DSP.getNumOutputs(
  numoutputs
);
numoutputs Out
Number of output DSPs.

This flushes the DSP queue (which blocks against the mixer) to ensure the output list is correct. You should avoid doing this during time-sensitive operations.

See Also: DSP::getNumInputs, DSP::getOutput

DSP::getNumParameters

Retrieves the number of parameters exposed by this unit.

C
C++
C#
JS

FMOD_RESULT DSP::getNumParameters(
  int *numparams
);
FMOD_RESULT FMOD_DSP_GetNumParameters(
  FMOD_DSP *dsp,
  int *numparams
);
RESULT DSP.getNumParameters(
  out int numparams
);
DSP.getNumParameters(
  numparams
);
numparams Out
Number of parameters.

Use this to enumerate all parameters of a DSP unit with DSP::getParameterInfo.

See Also: DSP::setParameterFloat, DSP::setParameterInt, DSP::setParameterBool, DSP::setParameterData

DSP::getOutput

Retrieves the DSP unit at the specified index in the output list.

C
C++
C#
JS

FMOD_RESULT DSP::getOutput(
  int index,
  DSP **output,
  DSPConnection **outputconnection
);
FMOD_RESULT FMOD_DSP_GetOutput(
  FMOD_DSP *dsp,
  int index,
  FMOD_DSP **output,
  FMOD_DSPCONNECTION **outputconnection
);
RESULT DSP.getOutput(
  int index,
  out DSP output,
  out DSPConnection outputconnection
);
DSP.getOutput(
  index,
  output,
  outputconnection
);
index

Offset into this DSP's output list.

output OutOpt
DSP unit at the specified index. (DSP)
outputconnection OutOpt
Connection between this unit and output. (DSPConnection)

This flushes the DSP queue (which blocks against the mixer) to ensure the output list is correct. You should avoid doing this during time-sensitive operations.

The returned connection will remain valid until the units are disconnected.

See Also: DSP::addInput, DSP::getInput

DSP::getOutputChannelFormat

Retrieves the output format this DSP produces when processing based on the input specified.

C
C++
C#
JS

FMOD_RESULT DSP::getOutputChannelFormat(
  FMOD_CHANNELMASK inmask,
  int inchannels,
  FMOD_SPEAKERMODE inspeakermode,
  FMOD_CHANNELMASK *outmask,
  int *outchannels,
  FMOD_SPEAKERMODE *outspeakermode
);
FMOD_RESULT FMOD_DSP_GetOutputChannelFormat(
  FMOD_DSP *dsp,
  FMOD_CHANNELMASK inmask,
  int inchannels,
  FMOD_SPEAKERMODE inspeakermode,
  FMOD_CHANNELMASK *outmask,
  int *outchannels,
  FMOD_SPEAKERMODE *outspeakermode
);
RESULT DSP.getOutputChannelFormat(
  CHANNELMASK inmask,
  int inchannels,
  SPEAKERMODE inspeakermode,
  out CHANNELMASK outmask,
  out int outchannels,
  out SPEAKERMODE outspeakermode
);
DSP.getOutputChannelFormat(
  inmask,
  inchannels,
  inspeakermode,
  outmask,
  outchannels,
  outspeakermode
);
inmask
Deprecated. (FMOD_CHANNELMASK)
inchannels
Number of channels for the input signal.
inspeakermode
Speaker mode for the input signal. (FMOD_SPEAKERMODE)
outmask OutOpt
Deprecated. (FMOD_CHANNELMASK)
outchannels OutOpt
Number of channels for the output signal.
outspeakermode OutOpt
Speaker mode for the output signal. (FMOD_SPEAKERMODE)

See Also: DSP::setChannelFormat, DSP::getChannelFormat

DSP::getParameterBool

Retrieves a boolean parameter by index.

C
C++
C#
JS

FMOD_RESULT DSP::getParameterBool(
  int index,
  bool *value,
  char *valuestr,
  int valuestrlen
);
FMOD_RESULT FMOD_DSP_GetParameterBool(
  FMOD_DSP *dsp,
  int index,
  FMOD_BOOL *value,
  char *valuestr,
  int valuestrlen
);
RESULT DSP.getParameterBool(
  int index,
  out bool value
);
DSP.getParameterBool(
  index,
  value,
  valuestr
);
index

Parameter index.

value OutOpt

Parameter boolean data.

  • Units: Boolean
valuestr OutOpt
String representation value. (UTF-8 string)
valuestrlen

Length of valuestr.

See Also: DSP::setParameterBool, DSP::getParameterInfo

DSP::getParameterData

Retrieves a binary data parameter by index.

C
C++
C#
JS

FMOD_RESULT DSP::getParameterData(
  int index,
  void **data,
  unsigned int *length,
  char *valuestr,
  int valuestrlen
);
FMOD_RESULT FMOD_DSP_GetParameterData(
  FMOD_DSP *dsp,
  int index,
  void **data,
  unsigned int *length,
  char *valuestr,
  int valuestrlen
);
RESULT DSP.getParameterData(
  int index,
  out IntPtr data,
  out uint length
);
DSP.getParameterData(
  index,
  data,
  length,
  valuestr
);
index

Parameter index.

data OutOpt
Parameter binary data.
length OutOpt

Length of data.

  • Units: Bytes
valuestr OutOpt
String representation data. (UTF-8 string)
valuestrlen

Length of valuestr.

See Also: DSP::setParameterData, DSP::getParameterInfo

DSP::getParameterFloat

Retrieves a floating point parameter by index.

C
C++
C#
JS

FMOD_RESULT DSP::getParameterFloat(
  int index,
  float *value,
  char *valuestr,
  int valuestrlen
);
FMOD_RESULT FMOD_DSP_GetParameterFloat(
  FMOD_DSP *dsp,
  int index,
  float *value,
  char *valuestr,
  int valuestrlen
);
RESULT DSP.getParameterFloat(
  int index,
  out float value
);
DSP.getParameterFloat(
  index,
  value,
  valuestr
);
index

Parameter index.

value OutOpt
Parameter floating point data.
valuestr OutOpt
String representation value. (UTF-8 string)
valuestrlen

Length of valuestr.

See Also: DSP::setParameterFloat, DSP::getParameterInfo

DSP::getParameterInfo

Retrieve information about a specified parameter.

C
C++
C#
JS

FMOD_RESULT DSP::getParameterInfo(
  int index,
  FMOD_DSP_PARAMETER_DESC **desc
);
FMOD_RESULT FMOD_DSP_GetParameterInfo(
  FMOD_DSP *dsp,
  int index,
  FMOD_DSP_PARAMETER_DESC **desc
);
RESULT DSP.getParameterInfo(
  int index,
  out DSP_PARAMETER_DESC desc
);
DSP.getParameterInfo(
  index,
  desc
);
index

Parameter index.

desc Out
Parameter description at the specified index. (FMOD_DSP_PARAMETER_DESC)

See Also: DSP::setParameterFloat, DSP::setParameterInt, DSP::setParameterBool, DSP::setParameterData

DSP::getParameterInt

Retrieves an integer parameter by index.

C
C++
C#
JS

FMOD_RESULT DSP::getParameterInt(
  int index,
  int *value,
  char *valuestr,
  int valuestrlen
);
FMOD_RESULT FMOD_DSP_GetParameterInt(
  FMOD_DSP *dsp,
  int index,
  int *value,
  char *valuestr,
  int valuestrlen
);
RESULT DSP.getParameterInt(
  int index,
  out int value
);
DSP.getParameterInt(
  index,
  value,
  valuestr
);
index

Parameter index.

value OutOpt
Parameter integer data.
valuestr OutOpt
String representation value. (UTF-8 string)
valuestrlen

Length of valuestr.

See Also: DSP::setParameterInt, DSP::getParameterInfo

DSP::getSystemObject

Retrieves the parent System object.

C
C++
C#
JS

FMOD_RESULT DSP::getSystemObject(
  System **system
);
FMOD_RESULT FMOD_DSP_GetSystemObject(
  FMOD_DSP *dsp,
  FMOD_SYSTEM **system
);
RESULT DSP.getSystemObject(
  out System system
);
DSP.getSystemObject(
  system
);
system Out
System object. (System)

See Also: System::createDSP, System::createDSPByType

DSP::getType

Retrieves the pre-defined type of a FMOD registered DSP unit.

C
C++
C#
JS

FMOD_RESULT DSP::getType(
  FMOD_DSP_TYPE *type
);
FMOD_RESULT FMOD_DSP_GetType(
  FMOD_DSP *dsp,
  FMOD_DSP_TYPE *type
);
RESULT DSP.getType(
  out DSP_TYPE type
);
DSP.getType(
  type
);
type Out
DSP type. (FMOD_DSP_TYPE)

This is only valid for the DSP types built in to the FMOD Engine. For user-created plug-in DSPs, it instead returns FMOD_DSP_TYPE_UNKNOWN.

DSP::getUserData

Retrieves a user value associated with this object.

C
C++
C#
JS

FMOD_RESULT DSP::getUserData(
  void **userdata
);
FMOD_RESULT FMOD_DSP_GetUserData(
  FMOD_DSP *dsp,
  void **userdata
);
RESULT DSP.getUserData(
  out IntPtr userdata
);
DSP.getUserData(
  userdata
);
userdata Out
User data set by calling DSP::setUserData.

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.

DSP::getWetDryMix

Retrieves the scale of the wet and dry signal components.

C
C++
C#
JS

FMOD_RESULT DSP::getWetDryMix(
  float *prewet,
  float *postwet,
  float *dry
);
FMOD_RESULT FMOD_DSP_GetWetDryMix(
  FMOD_DSP *dsp,
  float *prewet,
  float *postwet,
  float *dry
);
RESULT DSP.getWetDryMix(
  out float prewet,
  out float postwet,
  out float dry
);
DSP.getWetDryMix(
  prewet,
  postwet,
  dry
);
prewet OutOpt

Level of the 'Dry' (pre-processed signal) mix that is processed by the DSP. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.

  • Units: Linear
  • Range: (-inf, inf)
  • Default: 1
postwet OutOpt

Level of the 'Wet' (post-processed signal) mix that is output. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.

  • Units: Linear
  • Range: (-inf, inf)
  • Default: 1
dry OutOpt

Level of the 'Dry' (pre-processed signal) mix that is output. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.

  • Units: Linear
  • Range: (-inf, inf)
  • Default: 1

See Also: DSP::setWetDryMix

DSP::release

Releases a DSP unit, freeing the memory used by that object.

C
C++
C#
JS

FMOD_RESULT DSP::release();
FMOD_RESULT FMOD_DSP_Release(FMOD_DSP *dsp);
RESULT DSP.release();
DSP.release();

If DSP is not removed from the graph with ChannelControl::removeDSP after being added with ChannelControl::addDSP, it will not release and will instead return FMOD_ERR_DSP_INUSE.

See Also: System::createDSP

DSP::reset

Reset a DSP's internal state, making it ready for a new input signal.

C
C++
C#
JS

FMOD_RESULT DSP::reset();
FMOD_RESULT FMOD_DSP_Reset(FMOD_DSP *dsp);
RESULT DSP.reset();
DSP.reset();

This will clear all internal state derived from input signal while retaining any set parameter values. The intended use of the function is to avoid audible artifacts if moving the DSP from one part of the DSP graph to another.

DSP::setActive

Sets the processing active state.

C
C++
C#
JS

FMOD_RESULT DSP::setActive(
  bool active
);
FMOD_RESULT FMOD_DSP_SetActive(
  FMOD_DSP *dsp,
  FMOD_BOOL active
);
RESULT DSP.setActive(
  bool active
);
DSP.setActive(
  active
);
active

Active state.

  • Units: Boolean
  • Default: False

If active is false, processing of this unit and its inputs are stopped.

When created, a DSP is inactive. It is automatically activated when ChannelControl::addDSP is used; otherwise, it must be set to active manually.

See Also: DSP::getActive, DSP::setBypass, DSP::getBypass

DSP::setBypass

Sets the processing bypass state.

C
C++
C#
JS

FMOD_RESULT DSP::setBypass(
  bool bypass
);
FMOD_RESULT FMOD_DSP_SetBypass(
  FMOD_DSP *dsp,
  FMOD_BOOL bypass
);
RESULT DSP.setBypass(
  bool bypass
);
DSP.setBypass(
  bypass
);
bypass

Bypass state.

  • Units: Boolean
  • Default: False

If bypass is true, processing of this unit is skipped but it continues to process its inputs.

See Also: DSP::getBypass, DSP::setActive, DSP::getActive

DSP::setCallback

Sets the callback for DSP notifications.

C
C++
C#
JS

FMOD_RESULT DSP::setCallback(
  FMOD_DSP_CALLBACK callback
);
FMOD_RESULT FMOD_DSP_SetCallback(
  FMOD_DSP *dsp,
  FMOD_DSP_CALLBACK callback
);
RESULT DSP.setCallback(
  DSP_CALLBACK callback
);
DSP.setCallback(
  callback
);
callback
Callback to invoke. (FMOD_DSP_CALLBACK)

See Also: Callback Behavior, FMOD_DSP_CALLBACK_TYPE

DSP::setChannelFormat

Sets the PCM input format this DSP is to receive when processing.

C
C++
C#
JS

FMOD_RESULT DSP::setChannelFormat(
  FMOD_CHANNELMASK channelmask,
  int numchannels,
  FMOD_SPEAKERMODE source_speakermode
);
FMOD_RESULT FMOD_DSP_SetChannelFormat(
  FMOD_DSP *dsp,
  FMOD_CHANNELMASK channelmask,
  int numchannels,
  FMOD_SPEAKERMODE source_speakermode
);
RESULT DSP.setChannelFormat(
  CHANNELMASK channelmask,
  int numchannels,
  SPEAKERMODE source_speakermode
);
DSP.setChannelFormat(
  channelmask,
  numchannels,
  source_speakermode
);
channelmask
Deprecated. (FMOD_CHANNELMASK)
numchannels

Number of channels to be processed.

source_speakermode
Speaker mode to describe the channel mapping. (FMOD_SPEAKERMODE)

Setting the number of channels on a unit forces either a down or up mix to that channel count before processing the DSP read/process callback.

See Also: DSP::getChannelFormat

DSP::setMeteringEnabled

Sets the input and output signal metering enabled states.

C
C++
C#
JS

FMOD_RESULT DSP::setMeteringEnabled(
  bool inputEnabled,
  bool outputEnabled
);
FMOD_RESULT FMOD_DSP_SetMeteringEnabled(
  FMOD_DSP *dsp,
  FMOD_BOOL inputEnabled,
  FMOD_BOOL outputEnabled
);
RESULT DSP.setMeteringEnabled(
  bool inputEnabled,
  bool outputEnabled
);
DSP.setMeteringEnabled(
  inputEnabled,
  outputEnabled
);
inputEnabled

Metering enabled state for the input signal.

  • Units: Boolean
  • Default: False
outputEnabled

Metering enabled state for the output signal.

  • Units: Boolean
  • Default: False

Input metering is pre processing, while output metering is post processing.

Enabled metering allows DSP::getMeteringInfo to return metering information and allows FMOD profiling tools to visualize the levels.

FMOD_INIT_PROFILE_METER_ALL with System::init will automatically turn on metering for all DSP units inside the DSP graph.

This function must have inputEnabled and outputEnabled set to true if being used by the Studio API, such as in the Unity or Unreal Engine integrations, in order to avoid conflict with FMOD Studio's live update feature.

See Also: DSP::getMeteringEnabled

DSP::setParameterBool

Sets a boolean parameter by index.

C
C++
C#
JS

FMOD_RESULT DSP::setParameterBool(
  int index,
  bool value
);
FMOD_RESULT FMOD_DSP_SetParameterBool(
  FMOD_DSP *dsp,
  int index,
  FMOD_BOOL value
);
RESULT DSP.setParameterBool(
  int index,
  bool value
);
DSP.setParameterBool(
  index,
  value
);
index

Parameter index.

value

Parameter value.

  • Units: Boolean

See Also: DSP::getParameterInfo, DSP::getParameterBool

DSP::setParameterData

Sets a binary data parameter by index.

C
C++
C#
JS

FMOD_RESULT DSP::setParameterData(
  int index,
  void *data,
  unsigned int length
);
FMOD_RESULT FMOD_DSP_SetParameterData(
  FMOD_DSP *dsp,
  int index,
  void *data,
  unsigned int length
);
RESULT DSP.setParameterData(
  int index,
  byte[] data
);
DSP.setParameterData(
  index,
  data,
  length
);
index

Parameter index.

data
Parameter binary data.
length

Length of data.

  • Units: Bytes

Certain data types are predefined by the system and can be specified via the FMOD_DSP_PARAMETER_DESC_DATA, see FMOD_DSP_PARAMETER_DATA_TYPE

See Also: DSP::getParameterInfo, DSP::getParameterData

DSP::setParameterFloat

Sets a floating point parameter by index.

C
C++
C#
JS

FMOD_RESULT DSP::setParameterFloat(
  int index,
  float value
);
FMOD_RESULT FMOD_DSP_SetParameterFloat(
  FMOD_DSP *dsp,
  int index,
  float value
);
RESULT DSP.setParameterFloat(
  int index,
  float value
);
DSP.setParameterFloat(
  index,
  value
);
index

Parameter index.

value
Parameter floating point data.

See Also: DSP::getParameterInfo, DSP::getParameterFloat

DSP::setParameterInt

Sets an integer parameter by index.

C
C++
C#
JS

FMOD_RESULT DSP::setParameterInt(
  int index,
  int value
);
FMOD_RESULT FMOD_DSP_SetParameterInt(
  FMOD_DSP *dsp,
  int index,
  int value
);
RESULT DSP.setParameterInt(
  int index,
  int value
);
DSP.setParameterInt(
  index,
  value
);
index

Parameter index.

value
Parameter integer data.

See Also: DSP::getParameterInfo, DSP::getParameterInt

DSP::setUserData

Sets a user value associated with this object.

C
C++
C#
JS

FMOD_RESULT DSP::setUserData(
  void *userdata
);
FMOD_RESULT FMOD_DSP_SetUserData(
  FMOD_DSP *dsp,
  void *userdata
);
RESULT DSP.setUserData(
  IntPtr userdata
);
DSP.setUserData(
  userdata
);
userdata
Value stored on this object.

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: DSP::getUserData

DSP::setWetDryMix

Sets the scale of the wet and dry signal components.

C
C++
C#
JS

FMOD_RESULT DSP::setWetDryMix(
  float prewet,
  float postwet,
  float dry
);
FMOD_RESULT FMOD_DSP_SetWetDryMix(
  FMOD_DSP *dsp,
  float prewet,
  float postwet,
  float dry
);
RESULT DSP.setWetDryMix(
  float prewet,
  float postwet,
  float dry
);
DSP.setWetDryMix(
  prewet,
  postwet,
  dry
);
prewet

Level of the 'Dry' (pre-processed signal) mix that is processed by the DSP. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.

  • Units: Linear
  • Range: (-inf, inf)
  • Default: 1
postwet

Level of the 'Wet' (post-processed signal) mix that is output. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.

  • Units: Linear
  • Range: (-inf, inf)
  • Default: 1
dry

Level of the 'Dry' (pre-processed signal) mix that is output. 0 = silent, 1 = full. Negative level inverts the signal. Values larger than 1 amplify the signal.

  • Units: Linear
  • Range: (-inf, inf)
  • Default: 0

The dry signal path is silent by default, because DSP effects transform the input and pass the newly processed result to the output.

See Also: DSP::getWetDryMix

DSP::showConfigDialog

Display or hide a DSP unit configuration dialog box inside the target window.

C
C++
C#
JS

FMOD_RESULT DSP::showConfigDialog(
  void *hwnd,
  bool show
);
FMOD_RESULT FMOD_DSP_ShowConfigDialog(
  FMOD_DSP *dsp,
  void *hwnd,
  FMOD_BOOL show
);
RESULT DSP.showConfigDialog(
  IntPtr hwnd,
  bool show
);
DSP.showConfigDialog(
  hwnd,
  show
);
hwnd
Target HWND in windows to display configuration dialog.
show

Whether to show or hide the dialog box inside target hwnd.

  • Units: Boolean

Some DSP plug-ins (especially VST plug-ins) use dialog boxes to display graphical user interfaces for modifying their parameters, rather than using the other method of enumerating their parameters and setting them with DSP::setParameterFloat, DSP::setParameterInt, DSP::setParameterBool, or DSP::setParameterData.

To find out what size window to create to store the configuration screen, use DSP::getInfo where you can get the width and height.