FMOD Engine User Manual 2.03

7. Core API Reference | System

Management object from which all resources are created and played.

Create with System_Create.

Lifetime management:


Device selection:


Setup:



File system setup:


Plug-in support:



Network configuration:

Information:

Creation and retrieval:


Runtime control:



Recording:


Geometry management:

General:



FMOD_3D_ROLLOFF_CALLBACK

Callback to allow custom calculation of distance attenuation.

C
C++
C#
JS

float F_CALL FMOD_3D_ROLLOFF_CALLBACK(
  FMOD_CHANNELCONTROL *channelcontrol,
  float distance
);
delegate float CB_3D_ROLLOFFCALLBACK(
  IntPtr channelcontrol,
  float distance
);

Not supported for JavaScript.

channelcontrol
Channel being evaluated. (ChannelControl)
distance

Distance from the listener.

channelcontrol can be cast to Channel *.

See Also: System::set3DRolloffCallback, System::set3DListenerAttributes, System::get3DListenerAttributes

FMOD_ADVANCEDSETTINGS

Advanced configuration settings.

Structure to allow configuration of lesser used system level settings. These tweaks generally allow the user to set resource limits and customize settings to better fit their application.

C
C++
C#
JS

typedef struct FMOD_ADVANCEDSETTINGS {
  int                  cbSize;
  int                  maxMPEGCodecs;
  int                  maxADPCMCodecs;
  int                  maxXMACodecs;
  int                  maxVorbisCodecs;
  int                  maxAT9Codecs;
  int                  maxFADPCMCodecs;
  int                  maxOpusCodecs;
  int                  ASIONumChannels;
  char               **ASIOChannelList;
  FMOD_SPEAKER        *ASIOSpeakerList;
  float                vol0virtualvol;
  unsigned int         defaultDecodeBufferSize;
  unsigned short       profilePort;
  unsigned int         geometryMaxFadeTime;
  float                distanceFilterCenterFreq;
  int                  reverb3Dinstance;
  int                  DSPBufferPoolSize;
  FMOD_DSP_RESAMPLER   resamplerMethod;
  unsigned int         randomSeed;
  int                  maxConvolutionThreads;
  int                  maxSpatialObjects;
} FMOD_ADVANCEDSETTINGS;
struct ADVANCEDSETTINGS
{
  int           cbSize;
  int           maxMPEGCodecs;
  int           maxADPCMCodecs;
  int           maxXMACodecs;
  int           maxVorbisCodecs;
  int           maxAT9Codecs;
  int           maxFADPCMCodecs;
  int           maxOpusCodecs;
  int           ASIONumChannels;
  IntPtr        ASIOChannelList;
  IntPtr        ASIOSpeakerList;
  float         vol0virtualvol;
  uint          defaultDecodeBufferSize;
  ushort        profilePort;
  uint          geometryMaxFadeTime;
  float         distanceFilterCenterFreq;
  int           reverb3Dinstance;
  int           DSPBufferPoolSize;
  DSP_RESAMPLER resamplerMethod;
  uint          randomSeed;
  int           maxConvolutionThreads;
  int           maxSpatialObjects;
}
ADVANCEDSETTINGS
{
  maxMPEGCodecs,
  maxADPCMCodecs,
  maxXMACodecs,
  maxVorbisCodecs,
  maxAT9Codecs,
  maxFADPCMCodecs,
  maxOpusCodecs,
  ASIONumChannels,
  vol0virtualvol,
  defaultDecodeBufferSize,
  profilePort,
  geometryMaxFadeTime,
  distanceFilterCenterFreq,
  reverb3Dinstance,
  DSPBufferPoolSize,
  resamplerMethod,
  randomSeed,
  maxConvolutionThreads,
  maxSpatialObjects,
};
cbSize
Size of this structure. Must be set to sizeof(FMOD_ADVANCEDSETTINGS) before calling System::setAdvancedSettings or System::getAdvancedSettings.
maxMPEGCodecs Opt

Maximum MPEG Sounds created as FMOD_CREATECOMPRESSEDSAMPLE.

  • Default: 32
  • Range: [0, 256]
maxADPCMCodecs Opt

Maximum IMA-ADPCM Sounds created as FMOD_CREATECOMPRESSEDSAMPLE.

  • Default: 32
  • Range: [0, 256]
maxXMACodecs Opt

Maximum XMA Sounds created as FMOD_CREATECOMPRESSEDSAMPLE.

  • Default: 32
  • Range: [0, 256]
maxVorbisCodecs Opt

Maximum Vorbis Sounds created as FMOD_CREATECOMPRESSEDSAMPLE.

  • Default: 32
  • Range: [0, 256]
maxAT9Codecs Opt

Maximum AT9 Sounds created as FMOD_CREATECOMPRESSEDSAMPLE.

  • Default: 32
  • Range: [0, 256]
maxFADPCMCodecs Opt

Maximum FADPCM Sounds created as FMOD_CREATECOMPRESSEDSAMPLE.

  • Default: 32
  • Range: [0, 256]
maxOpusCodecs Opt

Maximum Opus Sounds created as FMOD_CREATECOMPRESSEDSAMPLE.

  • Default: 32
  • Range: [0, 256]
ASIONumChannels Opt

Number of elements in ASIOSpeakerList on input, number of elements in ASIOChannelList on output.

ASIOChannelList R/O
Read only list of strings representing ASIO channel names (UTF-8 string), count is defined by ASIONumChannels. Only valid after System::init.
ASIOSpeakerList Opt
List of speakers that represent each ASIO channel used for remapping, count is defined by ASIONumChannels. Use FMOD_SPEAKER_NONE to indicate no output for a given speaker. (FMOD_SPEAKER)
vol0virtualvol Opt

For use with FMOD_INIT_VOL0_BECOMES_VIRTUAL, Channels with audibility below this will become virtual. See the Virtual Voices guide for more information.

  • Units: Linear
  • Default: 0
defaultDecodeBufferSize Opt

For use with Streams, the default size of the double buffer.

  • Units: Milliseconds
  • Default: 400
  • Range: [0, 30000]
profilePort Opt

For use with FMOD_INIT_PROFILE_ENABLE, specify the port to listen on for connections by FMOD Studio or FMOD Profiler.

  • Default: 9264
geometryMaxFadeTime Opt

For use with Geometry, the maximum time it takes for a Channel to fade to the new volume level when its occlusion changes.

  • Units: Milliseconds
  • Default: 500
distanceFilterCenterFreq Opt

For use with FMOD_INIT_CHANNEL_DISTANCEFILTER, the default center frequency for the distance filter.

  • Units: Hertz
  • Default: 1500
  • Range: [10, 22050]
reverb3Dinstance Opt

For use with Reverb3D, selects which global reverb instance to use.

  • Range: [0, FMOD_REVERB_MAXINSTANCES)
DSPBufferPoolSize Opt

Number of intermediate mixing buffers in the DSP buffer pool. Each buffer in bytes is bufferlength (See System::getDSPBufferSize) * sizeof(float) * output mode speaker count (See FMOD_SPEAKERMODE). ie 7.1 @ 1024 DSP block size = 1024 * 4 * 8 = 32KB.

  • Default: 8
resamplerMethod Opt
Resampling method used by Channels. (FMOD_DSP_RESAMPLER)
randomSeed Opt
Seed value to initialize the internal random number generator.
maxConvolutionThreads Opt

Maximum number of CPU threads to use for FMOD_DSP_TYPE_CONVOLUTIONREVERB effect. 1 = effect is entirely processed inside the FMOD_THREAD_TYPE_MIXER thread. 2 and 3 offloads different parts of the convolution processing into different threads (FMOD_THREAD_TYPE_CONVOLUTION1 and FMOD_THREAD_TYPE_CONVOLUTION2 to increase throughput.

  • Default: 3
  • Range: [0, 3]
maxSpatialObjects Opt

Maximum Spatial Objects that can be reserved per FMOD system. FMOD_OUTPUTTYPE_AUDIO3D is a special case where multiple FMOD systems are not allowed. See the Object based approach section of the Spatial Audio white paper. A value of -1 means no Spatial Objects will be reserved. A value of 0 means all available Spatial Objects will be reserved. Any other value means it will reserve that many Spatial Objects.

  • Default: 0
  • Range: [-1, 65535]

All members have a default of 0 except for cbSize, so clearing the whole structure to zeroes first then setting cbSize is a common use pattern.

Specifying one of the codec maximums will help determine the maximum CPU usage of playing FMOD_CREATECOMPRESSEDSAMPLE Sounds of that type as well as the memory requirements. Memory will be allocated for 'up front' (during System::init) if these values are specified as non zero. If any are zero, it allocates memory for the codec whenever a file of the type in question is loaded. So if maxMPEGCodecs is 0 for example, it will allocate memory for the MPEG codecs the first time an MP3 is loaded or an MP3 based .FSB file is loaded.

Setting DSPBufferPoolSize pre-allocates memory for the FMOD DSP graph. See the DSP architecture guide. By default, eight buffers are created up front. A large graph might require more if the aim is to avoid real-time allocations from the FMOD mixer thread.

See Also: System::setAdvancedSettings, System::getAdvancedSettings

FMOD_ASYNCREADINFO

Information about a single asynchronous file operation.

C
C++
C#
JS

typedef struct FMOD_ASYNCREADINFO {
  void                      *handle;
  unsigned int               offset;
  unsigned int               sizebytes;
  int                        priority;
  void                      *userdata;
  void                      *buffer;
  unsigned int               bytesread;
  FMOD_FILE_ASYNCDONE_FUNC   done;
} FMOD_ASYNCREADINFO;
struct ASYNCREADINFO
{
  IntPtr                      handle;
  uint                        offset;
  uint                        sizebytes;
  int                         priority;
  IntPtr                      userdata;
  IntPtr                      buffer;
  uint                        bytesread;
  FILE_ASYNCDONE_FUNC         done;
}

Not supported for JavaScript.

handle R/O
File handle that was returned in FMOD_FILE_OPEN_CALLBACK.
offset R/O
Offset within the file where the read operation should occur.
sizebytes R/O
Number of bytes to read.
priority R/O
Priority hint for how quickly this operation should be serviced where 0 represents low importance and 100 represents extreme importance. This could be used to prioritize the read order of a file job queue for example. FMOD decides the importance of the read based on if it could degrade audio or not.
userdata Opt
User value associated with this async operation, passed to FMOD_FILE_ASYNCCANCEL_CALLBACK.
buffer
Buffer to read data into.
bytesread
Number of bytes read into buffer.
done R/O
Completion function to signal the async read is done. (FMOD_FILE_ASYNCDONE_FUNC)

When servicing the async read operation, read from handle at the given offset for sizebytes into buffer. Write the number of bytes read into bytesread then call done with the FMOD_RESULT that matches the success of the operation.

See Also: FMOD_FILE_ASYNCREAD_CALLBACK

FMOD_CREATESOUNDEXINFO

Additional options for creating a Sound.

C
C++
C#
JS

typedef struct FMOD_CREATESOUNDEXINFO {
  int                              cbsize;
  unsigned int                     length;
  unsigned int                     fileoffset;
  int                              numchannels;
  int                              defaultfrequency;
  FMOD_SOUND_FORMAT                format;
  unsigned int                     decodebuffersize;
  int                              initialsubsound;
  int                              numsubsounds;
  int                             *inclusionlist;
  int                              inclusionlistnum;
  FMOD_SOUND_PCMREAD_CALLBACK      pcmreadcallback;
  FMOD_SOUND_PCMSETPOS_CALLBACK    pcmsetposcallback;
  FMOD_SOUND_NONBLOCK_CALLBACK     nonblockcallback;
  const char                      *dlsname;
  const char                      *encryptionkey;
  int                              maxpolyphony;
  void                            *userdata;
  FMOD_SOUND_TYPE                  suggestedsoundtype;
  FMOD_FILE_OPEN_CALLBACK          fileuseropen;
  FMOD_FILE_CLOSE_CALLBACK         fileuserclose;
  FMOD_FILE_READ_CALLBACK          fileuserread;
  FMOD_FILE_SEEK_CALLBACK          fileuserseek;
  FMOD_FILE_ASYNCREAD_CALLBACK     fileuserasyncread;
  FMOD_FILE_ASYNCCANCEL_CALLBACK   fileuserasynccancel;
  void                            *fileuserdata;
  int                              filebuffersize;
  FMOD_CHANNELORDER                channelorder;
  FMOD_SOUNDGROUP                 *initialsoundgroup;
  unsigned int                     initialseekposition;
  FMOD_TIMEUNIT                    initialseekpostype;
  int                              ignoresetfilesystem;
  unsigned int                     audioqueuepolicy;
  unsigned int                     minmidigranularity;
  int                              nonblockthreadid;
  FMOD_GUID                       *fsbguid;
} FMOD_CREATESOUNDEXINFO;
struct CREATESOUNDEXINFO
{
  int                      cbsize;
  uint                     length;
  uint                     fileoffset;
  int                      numchannels;
  int                      defaultfrequency;
  SOUND_FORMAT             format;
  uint                     decodebuffersize;
  int                      initialsubsound;
  int                      numsubsounds;
  IntPtr                   inclusionlist;
  int                      inclusionlistnum;
  SOUND_PCMREADCALLBACK    pcmreadcallback;
  SOUND_PCMSETPOSCALLBACK  pcmsetposcallback;
  SOUND_NONBLOCKCALLBACK   nonblockcallback;
  IntPtr                   dlsname;
  IntPtr                   encryptionkey;
  int                      maxpolyphony;
  IntPtr                   userdata;
  SOUND_TYPE               suggestedsoundtype;
  FILE_OPENCALLBACK        fileuseropen;
  FILE_CLOSECALLBACK       fileuserclose;
  FILE_READCALLBACK        fileuserread;
  FILE_SEEKCALLBACK        fileuserseek;
  FILE_ASYNCREADCALLBACK   fileuserasyncread;
  FILE_ASYNCCANCELCALLBACK fileuserasynccancel;
  IntPtr                   fileuserdata;
  int                      filebuffersize;
  CHANNELORDER             channelorder;
  IntPtr                   initialsoundgroup;
  uint                     initialseekposition;
  TIMEUNIT                 initialseekpostype;
  int                      ignoresetfilesystem;
  uint                     audioqueuepolicy;
  uint                     minmidigranularity;
  int                      nonblockthreadid;
  IntPtr                   fsbguid;
}
CREATESOUNDEXINFO
{
  length,
  fileoffset,
  numchannels,
  defaultfrequency,
  format,
  decodebuffersize,
  initialsubsound,
  numsubsounds,
  inclusionlist,
  inclusionlistnum,
  pcmreadcallback,
  pcmsetposcallback,
  nonblockcallback,
  dlsname,
  encryptionkey,
  maxpolyphony,
  userdata,
  suggestedsoundtype,
  fileuseropen,
  fileuserclose,
  fileuserread,
  fileuserseek,
  fileuserasyncread,
  fileuserasynccancel,
  fileuserdata,
  filebuffersize,
  channelorder,
  initialsoundgroup,
  initialseekposition,
  initialseekpostype,
  ignoresetfilesystem,
  audioqueuepolicy,
  minmidigranularity,
  nonblockthreadid,
};
cbsize
Size of this structure. Must be set to sizeof(FMOD_CREATESOUNDEXINFO) before calling System::createSound or System::createStream.
length Opt

Bytes to read starting at fileoffset, or length of Sound to create for FMOD_OPENUSER, or length of name_or_data for FMOD_OPENMEMORY / FMOD_OPENMEMORY_POINT.

  • Units: Bytes
fileoffset Opt

File offset to start reading from.

  • Units: Bytes
numchannels Opt

Number of channels in sound data for FMOD_OPENUSER / FMOD_OPENRAW.

defaultfrequency Opt

Default frequency of sound data for FMOD_OPENUSER / FMOD_OPENRAW.

  • Units: Hertz
format Opt
Format of sound data for FMOD_OPENUSER / FMOD_OPENRAW. (FMOD_SOUND_FORMAT)
decodebuffersize Opt

Size of the decoded buffer for FMOD_CREATESTREAM, or the block size used with pcmreadcallback for FMOD_OPENUSER.

initialsubsound Opt
Initial subsound to seek to for FMOD_CREATESTREAM.
numsubsounds Opt
Number of subsounds available for FMOD_OPENUSER, or maximum subsounds to load from file.
inclusionlist Opt
List of subsound indices to load from file.
inclusionlistnum Opt
Number of items in inclusionlist.
pcmreadcallback Opt
Callback to provide audio for FMOD_OPENUSER, or capture audio as it is decoded. (FMOD_SOUND_PCMREAD_CALLBACK)
pcmsetposcallback Opt
Callback to perform seeking for FMOD_OPENUSER, or capture seek requests. (FMOD_SOUND_PCMSETPOS_CALLBACK)
nonblockcallback Opt
Callback to notify completion for FMOD_NONBLOCKING, occurs during creation and seeking / restarting streams. (FMOD_SOUND_NONBLOCK_CALLBACK)
dlsname Opt
File path for a FMOD_SOUND_TYPE_DLS sample set to use when loading a FMOD_SOUND_TYPE_MIDI file, see below for defaults.
encryptionkey Opt
Key for encrypted FMOD_SOUND_TYPE_FSB file, cannot be used in conjunction with FMOD_OPENMEMORY_POINT.
maxpolyphony Opt

Maximum voice count for FMOD_SOUND_TYPE_MIDI / FMOD_SOUND_TYPE_IT.

  • Default: 64
userdata Opt
User data to be attached to the Sound during creation, access via Sound::getUserData.
suggestedsoundtype Opt
Attempt to load using the specified type first instead of loading in codec priority order. (FMOD_SOUND_TYPE)
fileuseropen Opt
Callback for opening this file. (FMOD_FILE_OPEN_CALLBACK)
fileuserclose Opt
Callback for closing this file. (FMOD_FILE_CLOSE_CALLBACK)
fileuserread Opt
Callback for reading from this file. (FMOD_FILE_READ_CALLBACK)
fileuserseek Opt
Callback for seeking within this file. (FMOD_FILE_SEEK_CALLBACK)
fileuserasyncread Opt
Callback for seeking within this file. (FMOD_FILE_ASYNCREAD_CALLBACK)
fileuserasynccancel Opt
Callback for seeking within this file. (FMOD_FILE_ASYNCCANCEL_CALLBACK)
fileuserdata Opt
User data to be passed into the file callbacks.
filebuffersize Opt
Buffer size for reading the file, -1 to disable buffering.
channelorder Opt
Custom ordering of speakers for this sound data. (FMOD_CHANNELORDER)
initialsoundgroup Opt
SoundGroup to place this Sound in once created. (SoundGroup)
initialseekposition Opt
Initial position to seek to for FMOD_CREATESTREAM.
initialseekpostype Opt
Time units for initialseekposition. (FMOD_TIMEUNIT)
ignoresetfilesystem Opt
Ignore System::setFileSystem and FMOD_CREATESOUNDEXINFO file callbacks.
audioqueuepolicy Opt
Hardware / software decoding policy for FMOD_SOUND_TYPE_AUDIOQUEUE, see FMOD_AUDIOQUEUE_CODECPOLICY.
minmidigranularity Opt

Mixer granularity for FMOD_SOUND_TYPE_MIDI sounds, smaller numbers give a more accurate reproduction at the cost of higher CPU usage.

  • Units: Samples
  • Default: 512
nonblockthreadid Opt

Thread index to execute FMOD_NONBLOCKING loads on for parallel Sound loading.

  • Range: [0, 4]
fsbguid Opt
On input, GUID of already loaded FMOD_SOUND_TYPE_FSB file to reduce disk access, on output, GUID of loaded FSB. (FMOD_GUID)

Loading a file from memory:

Loading a file from within another larger (possibly wad/pak) file, by giving the loader an offset and length:

Create a user created / non-file based sound:

Load an FSB stream seeking to a specific subsound in one file operation:

Load a subset of the Sounds in an FSB saving memory:

Capture sound data as it is decoded:

Provide a custom DLS for MIDI playback:

Setting the decodebuffersize is for CPU intensive codecs that may be causing stuttering, not file intensive codecs (i.e. those from CD or net streams) which are normally altered with System::setStreamBufferSize. As an example of CPU intensive codecs, an MP3 file will take more CPU to decode than a PCM wav file.

If you hear stuttering, then the codec is using more CPU than the decode buffer playback rate can keep up with. Increasing the decodebuffersize is likely to solve this problem.

FSB codec. If inclusionlist and numsubsounds are used together, this will trigger a special mode where subsounds are shuffled down to save memory (useful for large FSB files where you only want to load 1 sound). There will be no gaps, ie no null subsounds. As an example, if there are 10,000 subsounds and there is an inclusionlist with only 1 entry, and numsubsounds = 1, then subsound 0 will be that entry, and there will only be the memory allocated for 1 subsound. Previously there would still be 10,000 subsound pointers and other associated codec entries allocated along with it multiplied by 10,000.

See Also: Callback Behavior, System::createSound

FMOD_DRIVER_STATE

Flags that provide additional information about a particular driver.

C
C++
C#
JS

#define FMOD_DRIVER_STATE_CONNECTED   0x00000001
#define FMOD_DRIVER_STATE_DEFAULT     0x00000002
[Flags]
enum DRIVER_STATE : uint
{
  CONNECTED = 0x00000001,
  DEFAULT   = 0x00000002,
}
DRIVER_STATE_CONNECTED = 0x00000001
DRIVER_STATE_DEFAULT   = 0x00000002
FMOD_DRIVER_STATE_CONNECTED
Device is currently plugged in.
FMOD_DRIVER_STATE_DEFAULT
Device is the users preferred choice.

See Also: System::getRecordDriverInfo

FMOD_DSP_RESAMPLER

List of interpolation types used for resampling.

C
C++
C#
JS

typedef enum FMOD_DSP_RESAMPLER {
  FMOD_DSP_RESAMPLER_DEFAULT,
  FMOD_DSP_RESAMPLER_NOINTERP,
  FMOD_DSP_RESAMPLER_LINEAR,
  FMOD_DSP_RESAMPLER_CUBIC,
  FMOD_DSP_RESAMPLER_SPLINE,
  FMOD_DSP_RESAMPLER_MAX
} FMOD_DSP_RESAMPLER;
enum DSP_RESAMPLER : int
{
  DEFAULT,
  NOINTERP,
  LINEAR,
  CUBIC,
  SPLINE,
  MAX
}
DSP_RESAMPLER_DEFAULT
DSP_RESAMPLER_NOINTERP
DSP_RESAMPLER_LINEAR
DSP_RESAMPLER_CUBIC
DSP_RESAMPLER_SPLINE
DSP_RESAMPLER_MAX
FMOD_DSP_RESAMPLER_DEFAULT
Default interpolation method, same as FMOD_DSP_RESAMPLER_LINEAR.
FMOD_DSP_RESAMPLER_NOINTERP
No interpolation. High frequency aliasing hiss will be audible depending on the sample rate of the sound.
FMOD_DSP_RESAMPLER_LINEAR
Linear interpolation (default method). Fast and good quality, causes very slight lowpass effect on low frequency sounds.
FMOD_DSP_RESAMPLER_CUBIC
Cubic interpolation. Slower than linear interpolation but better quality.
FMOD_DSP_RESAMPLER_SPLINE
5 point spline interpolation. Slowest resampling method but best quality.
FMOD_DSP_RESAMPLER_MAX
Maximum number of resample methods supported.

Use System::setAdvancedSettings and FMOD_ADVANCEDSETTINGS::resamplerMethod to configure the resampling quality you require for sample rate conversion during sound playback.

FMOD_ERRORCALLBACK_INFO

Information describing an error that has occurred.

C
C++
C#
JS

typedef struct FMOD_ERRORCALLBACK_INFO {
  FMOD_RESULT                       result;
  FMOD_ERRORCALLBACK_INSTANCETYPE   instancetype;
  void                             *instance;
  const char                       *functionname;
  const char                       *functionparams;
} FMOD_ERRORCALLBACK_INFO;
struct ERRORCALLBACK_INFO
{
  RESULT                      result;
  ERRORCALLBACK_INSTANCETYPE  instancetype;
  IntPtr                      instance;
  StringWrapper               functionname;
  StringWrapper               functionparams;
}
ERRORCALLBACK_INFO
{
  result,
  instancetype,
  instance,
  functionname,
  functionparams,
};
result
Error code result. (FMOD_RESULT)
instancetype
Type of instance the error occurred on. (FMOD_ERRORCALLBACK_INSTANCETYPE)
instance
Instance pointer.
functionname
Function that the error occurred on. (UTF-8 string)
functionparams
Function parameters that the error ocurred on. (UTF-8 string)

The instance pointer will be a type corresponding to the instanceType enum.

See Also: FMOD_SYSTEM_CALLBACK, FMOD_SYSTEM_CALLBACK_ERROR

FMOD_ERRORCALLBACK_INSTANCETYPE

Identifier used to represent the different types of instance in the error callback.

C
C++
C#
JS

typedef enum FMOD_ERRORCALLBACK_INSTANCETYPE {
  FMOD_ERRORCALLBACK_INSTANCETYPE_NONE,
  FMOD_ERRORCALLBACK_INSTANCETYPE_SYSTEM,
  FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNEL,
  FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNELGROUP,
  FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNELCONTROL,
  FMOD_ERRORCALLBACK_INSTANCETYPE_SOUND,
  FMOD_ERRORCALLBACK_INSTANCETYPE_SOUNDGROUP,
  FMOD_ERRORCALLBACK_INSTANCETYPE_DSP,
  FMOD_ERRORCALLBACK_INSTANCETYPE_DSPCONNECTION,
  FMOD_ERRORCALLBACK_INSTANCETYPE_GEOMETRY,
  FMOD_ERRORCALLBACK_INSTANCETYPE_REVERB3D,
  FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_SYSTEM,
  FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_EVENTDESCRIPTION,
  FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_EVENTINSTANCE,
  FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_PARAMETERINSTANCE,
  FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_BUS,
  FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_VCA,
  FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_BANK,
  FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_COMMANDREPLAY
} FMOD_ERRORCALLBACK_INSTANCETYPE;
enum ERRORCALLBACK_INSTANCETYPE
{
  NONE,
  SYSTEM,
  CHANNEL,
  CHANNELGROUP,
  CHANNELCONTROL,
  SOUND,
  SOUNDGROUP,
  DSP,
  DSPCONNECTION,
  GEOMETRY,
  REVERB3D,
  STUDIO_SYSTEM,
  STUDIO_EVENTDESCRIPTION,
  STUDIO_EVENTINSTANCE,
  STUDIO_PARAMETERINSTANCE,
  STUDIO_BUS,
  STUDIO_VCA,
  STUDIO_BANK,
  STUDIO_COMMANDREPLAY
}
ERRORCALLBACK_INSTANCETYPE_NONE
ERRORCALLBACK_INSTANCETYPE_SYSTEM
ERRORCALLBACK_INSTANCETYPE_CHANNEL
ERRORCALLBACK_INSTANCETYPE_CHANNELGROUP
ERRORCALLBACK_INSTANCETYPE_CHANNELCONTROL
ERRORCALLBACK_INSTANCETYPE_SOUND
ERRORCALLBACK_INSTANCETYPE_SOUNDGROUP
ERRORCALLBACK_INSTANCETYPE_DSP
ERRORCALLBACK_INSTANCETYPE_DSPCONNECTION
ERRORCALLBACK_INSTANCETYPE_GEOMETRY
ERRORCALLBACK_INSTANCETYPE_REVERB3D
ERRORCALLBACK_INSTANCETYPE_STUDIO_SYSTEM
ERRORCALLBACK_INSTANCETYPE_STUDIO_EVENTDESCRIPTION
ERRORCALLBACK_INSTANCETYPE_STUDIO_EVENTINSTANCE
ERRORCALLBACK_INSTANCETYPE_STUDIO_PARAMETERINSTANCE
ERRORCALLBACK_INSTANCETYPE_STUDIO_BUS
ERRORCALLBACK_INSTANCETYPE_STUDIO_VCA
ERRORCALLBACK_INSTANCETYPE_STUDIO_BANK
ERRORCALLBACK_INSTANCETYPE_STUDIO_COMMANDREPLAY
FMOD_ERRORCALLBACK_INSTANCETYPE_NONE
Type representing no known instance type.
FMOD_ERRORCALLBACK_INSTANCETYPE_SYSTEM
Type representing System.
FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNEL
Type representing Channel.
FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNELGROUP
Type representing ChannelGroup.
FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNELCONTROL
Type representing ChannelControl.
FMOD_ERRORCALLBACK_INSTANCETYPE_SOUND
Type representing Sound.
FMOD_ERRORCALLBACK_INSTANCETYPE_SOUNDGROUP
Type representing SoundGroup.
FMOD_ERRORCALLBACK_INSTANCETYPE_DSP
Type representing DSP.
FMOD_ERRORCALLBACK_INSTANCETYPE_DSPCONNECTION
Type representing DSPConnection.
FMOD_ERRORCALLBACK_INSTANCETYPE_GEOMETRY
Type representing Geometry.
FMOD_ERRORCALLBACK_INSTANCETYPE_REVERB3D
Type representing Reverb3D.
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_SYSTEM
Type representing Studio::System.
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_EVENTDESCRIPTION
Type representing Studio::EventDescription.
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_EVENTINSTANCE
Type representing Studio::EventInstance.
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_PARAMETERINSTANCE
Deprecated.
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_BUS
Type representing Studio::Bus.
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_VCA
Type representing Studio::VCA.
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_BANK
Type representing Studio::Bank.
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_COMMANDREPLAY
Type representing Studio::CommandReplay.

See Also: FMOD_ERRORCALLBACK_INFO, FMOD_SYSTEM_CALLBACK, FMOD_SYSTEM_CALLBACK_ERROR

FMOD_FILE_ASYNCCANCEL_CALLBACK

Callback for cancelling a pending asynchronous read.

This callback is called to stop/release or shut down the resource that is holding the file, for example: releasing a Sound stream.

C
C++
C#
JS

FMOD_RESULT F_CALL FMOD_FILE_ASYNCCANCEL_CALLBACK(
  FMOD_ASYNCREADINFO *info,
  void *userdata
);
delegate RESULT FILE_ASYNCCANCELCALLBACK(
  IntPtr info,
  IntPtr userdata
);

Not supported for JavaScript.

info
Information describing the asynchronous read operation to cancel. (FMOD_ASYNCREADINFO)
userdata Opt
User value set by FMOD_CREATESOUNDEXINFO::fileuserdata or FMOD_STUDIO_BANK_INFO::userData.

Before returning from this callback the implementation must ensure that all references to info are relinquished.

See Also: System::setFileSystem, FMOD_FILE_OPEN_CALLBACK, FMOD_FILE_CLOSE_CALLBACK, FMOD_FILE_READ_CALLBACK, FMOD_FILE_SEEK_CALLBACK, FMOD_FILE_ASYNCREAD_CALLBACK

FMOD_FILE_ASYNCDONE_FUNC

Function to be called when asynchronous reading is finished.

C
C++
C#
JS

void F_CALL FMOD_FILE_ASYNCDONE_FUNC(
  FMOD_ASYNCREADINFO *info,
  FMOD_RESULT result
);
delegate void FILE_ASYNCDONE_FUNC(
  IntPtr info,
  RESULT result
);

Not supported for JavaScript.

info
Async info for the completed operation. (FMOD_ASYNCREADINFO)
result
The result of the read operation. (FMOD_RESULT)

Relevant result codes to use with this function include:

FMOD_FILE_ASYNCREAD_CALLBACK

Callback for reading from a file asynchronously.

C
C++
C#
JS

FMOD_RESULT F_CALL FMOD_FILE_ASYNCREAD_CALLBACK(
  FMOD_ASYNCREADINFO *info,
  void *userdata
);
delegate RESULT FILE_ASYNCREADCALLBACK(
  IntPtr info,
  IntPtr userdata
);

Not supported for JavaScript.

info
Information describing the requested asynchronous read operation. (FMOD_ASYNCREADINFO)
userdata Opt
User value set by FMOD_CREATESOUNDEXINFO::fileuserdata or FMOD_STUDIO_BANK_INFO::userData.

This callback allows you to accept a file I/O request without servicing it immediately. The callback can queue or store the FMOD_ASYNCREADINFO structure pointer, so that a 'servicing routine' can read the data and mark the job as done.

Marking an asynchronous job as 'done' outside of this callback can be done by calling the FMOD_ASYNCREADINFO::done function pointer with the file read result as a parameter.

If the servicing routine is processed in the same thread as the thread that invokes this callback (for example the thread that calls System::createSound or System::createStream), a deadlock will occur because while System::createSound or System::createStream waits for the file data, the servicing routine in the main thread won't be able to execute.

This typically means an outside servicing routine should typically be run in a separate thread.

The read request can be queued or stored and this callback can return immediately with FMOD_OK. Returning an error at this point will cause FMOD to stop what it was doing and return back to the caller. If it is from FMOD's stream thread, the stream will typically stop.

See Also: System::setFileSystem, FMOD_FILE_OPEN_CALLBACK, FMOD_FILE_CLOSE_CALLBACK, FMOD_FILE_READ_CALLBACK, FMOD_FILE_SEEK_CALLBACK, FMOD_FILE_ASYNCCANCEL_CALLBACK

FMOD_FILE_CLOSE_CALLBACK

Calback for closing a file.

C
C++
C#
JS

FMOD_RESULT F_CALL FMOD_FILE_CLOSE_CALLBACK(
  void *handle,
  void *userdata
);
delegate RESULT FILE_CLOSECALLBACK(
  IntPtr handle,
  IntPtr userdata
);
function FMOD_FILE_CLOSE_CALLBACK(
  handle,
  userdata
)
handle
File handle that was returned in FMOD_FILE_OPEN_CALLBACK.
userdata
User value set by FMOD_CREATESOUNDEXINFO::fileuserdata or FMOD_STUDIO_BANK_INFO::userData.

Close any user created file handle and perform any cleanup necessary for the file here. If the callback is from System::attachFileSystem, then the return value is ignored.

See Also: System::setFileSystem, FMOD_FILE_OPEN_CALLBACK, FMOD_FILE_READ_CALLBACK, FMOD_FILE_SEEK_CALLBACK, FMOD_FILE_ASYNCREAD_CALLBACK, FMOD_FILE_ASYNCCANCEL_CALLBACK

FMOD_FILE_OPEN_CALLBACK

Callback for opening a file.

C
C++
C#
JS

FMOD_RESULT F_CALL FMOD_FILE_OPEN_CALLBACK(
  const char *name,
  unsigned int *filesize,
  void **handle,
  void *userdata
);
delegate RESULT FILE_OPENCALLBACK(
  IntPtr name,
  ref uint filesize,
  ref IntPtr handle,
  IntPtr userdata
);
function FMOD_FILE_OPEN_CALLBACK(
  name,
  filesize,
  handle,
  userdata
)
name
File name or identifier. (UTF-8 string)
filesize Out

Size of the file.

  • Units: Bytes
handle Out
Handle to identify this file in future file callbacks.
userdata
User value set by FMOD_CREATESOUNDEXINFO::fileuserdata or FMOD_STUDIO_BANK_INFO::userData.

Return the appropriate error code such as FMOD_ERR_FILE_NOTFOUND if the file fails to open. If the callback is from System::attachFileSystem, then the return value is ignored.

The 'name' argument can be used via StringWrapper by using FMOD.StringWrapper nameStr = new FMOD.StringWrapper(name);

See Also: System::setFileSystem, FMOD_FILE_CLOSE_CALLBACK, FMOD_FILE_READ_CALLBACK, FMOD_FILE_SEEK_CALLBACK, FMOD_FILE_ASYNCREAD_CALLBACK, FMOD_FILE_ASYNCCANCEL_CALLBACK

FMOD_FILE_READ_CALLBACK

Callback for reading from a file.

C
C++
C#
JS

FMOD_RESULT F_CALL FMOD_FILE_READ_CALLBACK(
  void *handle,
  void *buffer,
  unsigned int sizebytes,
  unsigned int *bytesread,
  void *userdata
);
delegate RESULT FILE_READCALLBACK(
  IntPtr handle,
  IntPtr buffer,
  uint sizebytes,
  ref uint bytesread,
  IntPtr userdata
);
function FMOD_FILE_READ_CALLBACK(
  handle,
  buffer,
  sizebytes,
  bytesread,
  userdata
)
handle
File handle that was returned in FMOD_FILE_OPEN_CALLBACK.
buffer Out
Buffer to read data into.
sizebytes

Number of bytes to read into buffer.

  • Units: Bytes
bytesread Out

Number of bytes read into buffer.

  • Units: Bytes
userdata
User value set by FMOD_CREATESOUNDEXINFO::fileuserdata or FMOD_STUDIO_BANK_INFO::userData.

If the callback is from System::attachFileSystem, then the return value is ignored.

If there is not enough data to read the requested number of bytes, return fewer bytes in the bytesread parameter and and return FMOD_ERR_FILE_EOF.

See Also: System::setFileSystem, FMOD_FILE_OPEN_CALLBACK, FMOD_FILE_CLOSE_CALLBACK, FMOD_FILE_SEEK_CALLBACK, FMOD_FILE_ASYNCREAD_CALLBACK, FMOD_FILE_ASYNCCANCEL_CALLBACK

FMOD_FILE_SEEK_CALLBACK

Callback for seeking within a file.

C
C++
C#
JS

FMOD_RESULT F_CALL FMOD_FILE_SEEK_CALLBACK(
  void *handle,
  unsigned int pos,
  void *userdata
);
delegate RESULT FILE_SEEKCALLBACK(
  IntPtr handle,
  uint pos,
  IntPtr userdata
);
function FMOD_FILE_SEEK_CALLBACK(
  handle,
  pos,
  userdata
)
handle
File handle that returned in FMOD_FILE_OPEN_CALLBACK.
pos

Absolute position to seek to in file.

  • Units: Bytes
userdata
User value set by FMOD_CREATESOUNDEXINFO::fileuserdata or FMOD_STUDIO_BANK_INFO::userData.

If the callback is from System::attachFileSystem, then the return value is ignored.

See Also: System::setFileSystem, FMOD_FILE_OPEN_CALLBACK, FMOD_FILE_CLOSE_CALLBACK, FMOD_FILE_READ_CALLBACK, FMOD_FILE_ASYNCREAD_CALLBACK, FMOD_FILE_ASYNCCANCEL_CALLBACK

FMOD_INITFLAGS

Configuration flags used when initializing the System object.

C
C++
C#
JS

#define FMOD_INIT_NORMAL                     0x00000000
#define FMOD_INIT_STREAM_FROM_UPDATE         0x00000001
#define FMOD_INIT_MIX_FROM_UPDATE            0x00000002
#define FMOD_INIT_3D_RIGHTHANDED             0x00000004
#define FMOD_INIT_CLIP_OUTPUT                0x00000008
#define FMOD_INIT_CHANNEL_LOWPASS            0x00000100
#define FMOD_INIT_CHANNEL_DISTANCEFILTER     0x00000200
#define FMOD_INIT_PROFILE_ENABLE             0x00010000
#define FMOD_INIT_VOL0_BECOMES_VIRTUAL       0x00020000
#define FMOD_INIT_GEOMETRY_USECLOSEST        0x00040000
#define FMOD_INIT_PREFER_DOLBY_DOWNMIX       0x00080000
#define FMOD_INIT_THREAD_UNSAFE              0x00100000
#define FMOD_INIT_PROFILE_METER_ALL          0x00200000
#define FMOD_INIT_MEMORY_TRACKING            0x00400000
[Flags]
enum INITFLAGS : uint
{
  NORMAL                     = 0x00000000,
  STREAM_FROM_UPDATE         = 0x00000001,
  MIX_FROM_UPDATE            = 0x00000002,
  _3D_RIGHTHANDED            = 0x00000004,
  CLIP_OUTPUT                = 0x00000008,
  CHANNEL_LOWPASS            = 0x00000100,
  CHANNEL_DISTANCEFILTER     = 0x00000200,
  PROFILE_ENABLE             = 0x00010000,
  VOL0_BECOMES_VIRTUAL       = 0x00020000,
  GEOMETRY_USECLOSEST        = 0x00040000,
  PREFER_DOLBY_DOWNMIX       = 0x00080000,
  THREAD_UNSAFE              = 0x00100000,
  PROFILE_METER_ALL          = 0x00200000,
  MEMORY_TRACKING            = 0x00400000,
}
INIT_NORMAL                 = 0x00000000
INIT_STREAM_FROM_UPDATE     = 0x00000001
INIT_MIX_FROM_UPDATE        = 0x00000002
INIT_3D_RIGHTHANDED         = 0x00000004
INIT_CLIP_OUTPUT            = 0x00000008
INIT_CHANNEL_LOWPASS        = 0x00000100
INIT_CHANNEL_DISTANCEFILTER = 0x00000200
INIT_PROFILE_ENABLE         = 0x00010000
INIT_VOL0_BECOMES_VIRTUAL   = 0x00020000
INIT_GEOMETRY_USECLOSEST    = 0x00040000
INIT_PREFER_DOLBY_DOWNMIX   = 0x00080000
INIT_THREAD_UNSAFE          = 0x00100000
INIT_PROFILE_METER_ALL      = 0x00200000
INIT_MEMORY_TRACKING        = 0x00400000
FMOD_INIT_NORMAL
Initialize normally
FMOD_INIT_STREAM_FROM_UPDATE
No stream thread is created internally. Streams are driven from System::update. Mainly used with non-realtime outputs.
FMOD_INIT_MIX_FROM_UPDATE
No mixer thread is created internally. Mixing is driven from System::update. Only applies to polling based output modes such as FMOD_OUTPUTTYPE_NOSOUND, FMOD_OUTPUTTYPE_WAVWRITER.
FMOD_INIT_3D_RIGHTHANDED
3D calculations will be performed in right-handed coordinates, instead of the default of left-handed coordinates. See the Handedness section of the Glossary for more information.
FMOD_INIT_CLIP_OUTPUT
Enables hard clipping of output values greater than 1.0f or less than -1.0f.
FMOD_INIT_CHANNEL_LOWPASS
Enables usage of ChannelControl::setLowPassGain, ChannelControl::set3DOcclusion, or automatic usage by the Geometry API. All voices will add a software lowpass filter effect into the DSP chain which is idle unless one of the previous functions/features are used.
FMOD_INIT_CHANNEL_DISTANCEFILTER
All FMOD_3D based voices add a software low pass and highpass filter effect into the DSP chain, which acts as a distance-automated bandpass filter. Use System::setAdvancedSettings to adjust the center frequency.
FMOD_INIT_PROFILE_ENABLE
Enable TCP/IP based host which allows FMOD Studio or FMOD Profiler to connect to it, and view memory, CPU and the DSP graph in real-time.
FMOD_INIT_VOL0_BECOMES_VIRTUAL
Any sounds that are 0 volume will go virtual and not be processed except for having their positions updated virtually. Use System::setAdvancedSettings to adjust what volume besides zero to switch to virtual at.
FMOD_INIT_GEOMETRY_USECLOSEST
With the geometry engine, only process the closest polygon rather than accumulating all polygons the sound to listener line intersects.
FMOD_INIT_PREFER_DOLBY_DOWNMIX
When using FMOD_SPEAKERMODE_5POINT1 with a stereo output device, use the Dolby Pro Logic II downmix algorithm instead of the default stereo downmix algorithm.
FMOD_INIT_THREAD_UNSAFE
Disables thread safety for API calls. Only use this if FMOD is being called from a single thread, and if Studio API is not being used!
FMOD_INIT_PROFILE_METER_ALL
Slower, but adds level metering for every single DSP unit in the graph. Use DSP::setMeteringEnabled to turn meters off individually. Setting this flag implies FMOD_INIT_PROFILE_ENABLE.
FMOD_INIT_MEMORY_TRACKING
Enables memory allocation tracking. Currently this is only useful when using the Studio API. Increases memory footprint and reduces performance. This flag is implied by FMOD_STUDIO_INIT_MEMORY_TRACKING.

See Also: System::init

FMOD_OUTPUTTYPE

Built-in output types that can be used to run the mixer.

C
C++
C#
JS

typedef enum FMOD_OUTPUTTYPE {
  FMOD_OUTPUTTYPE_AUTODETECT,
  FMOD_OUTPUTTYPE_UNKNOWN,
  FMOD_OUTPUTTYPE_NOSOUND,
  FMOD_OUTPUTTYPE_WAVWRITER,
  FMOD_OUTPUTTYPE_NOSOUND_NRT,
  FMOD_OUTPUTTYPE_WAVWRITER_NRT,
  FMOD_OUTPUTTYPE_WASAPI,
  FMOD_OUTPUTTYPE_ASIO,
  FMOD_OUTPUTTYPE_PULSEAUDIO,
  FMOD_OUTPUTTYPE_ALSA,
  FMOD_OUTPUTTYPE_COREAUDIO,
  FMOD_OUTPUTTYPE_AUDIOTRACK,
  FMOD_OUTPUTTYPE_OPENSL,
  FMOD_OUTPUTTYPE_AUDIOOUT,
  FMOD_OUTPUTTYPE_AUDIO3D,
  FMOD_OUTPUTTYPE_WEBAUDIO,
  FMOD_OUTPUTTYPE_NNAUDIO,
  FMOD_OUTPUTTYPE_WINSONIC,
  FMOD_OUTPUTTYPE_AAUDIO,
  FMOD_OUTPUTTYPE_AUDIOWORKLET,
  FMOD_OUTPUTTYPE_PHASE,
  FMOD_OUTPUTTYPE_OHAUDIO,
  FMOD_OUTPUTTYPE_MAX
} FMOD_OUTPUTTYPE;
enum OUTPUTTYPE : int
{
  AUTODETECT,
  UNKNOWN,
  NOSOUND,
  WAVWRITER,
  NOSOUND_NRT,
  WAVWRITER_NRT,
  WASAPI,
  ASIO,
  PULSEAUDIO,
  ALSA,
  COREAUDIO,
  AUDIOTRACK,
  OPENSL,
  AUDIOOUT,
  AUDIO3D,
  WEBAUDIO,
  NNAUDIO,
  WINSONIC,
  AAUDIO,
  AUDIOWORKLET,
  PHASE,
  OHAUDIO,
  MAX,
}
OUTPUTTYPE_AUTODETECT
OUTPUTTYPE_UNKNOWN
OUTPUTTYPE_NOSOUND
OUTPUTTYPE_WAVWRITER
OUTPUTTYPE_NOSOUND_NRT
OUTPUTTYPE_WAVWRITER_NRT
OUTPUTTYPE_WASAPI
OUTPUTTYPE_ASIO
OUTPUTTYPE_PULSEAUDIO
OUTPUTTYPE_ALSA
OUTPUTTYPE_COREAUDIO
OUTPUTTYPE_AUDIOTRACK
OUTPUTTYPE_OPENSL
OUTPUTTYPE_AUDIOOUT
OUTPUTTYPE_AUDIO3D
OUTPUTTYPE_WEBAUDIO
OUTPUTTYPE_NNAUDIO
OUTPUTTYPE_WINSONIC
OUTPUTTYPE_AAUDIO
OUTPUTTYPE_AUDIOWORKLET
OUTPUTTYPE_PHASE
OUTPUTTYPE_OHAUDIO
OUTPUTTYPE_MAX
FMOD_OUTPUTTYPE_AUTODETECT
Picks the best output mode for the platform. This is the default.
FMOD_OUTPUTTYPE_UNKNOWN
All - 3rd party plug-in, unknown. This is for use with System::getOutput only.
FMOD_OUTPUTTYPE_NOSOUND
All - Perform all mixing but discard the final output.
FMOD_OUTPUTTYPE_WAVWRITER
All - Writes output to a .wav file.
FMOD_OUTPUTTYPE_NOSOUND_NRT
All - Non-realtime version of FMOD_OUTPUTTYPE_NOSOUND, one mix per System::update.
FMOD_OUTPUTTYPE_WAVWRITER_NRT
All - Non-realtime version of FMOD_OUTPUTTYPE_WAVWRITER, one mix per System::update.
FMOD_OUTPUTTYPE_WASAPI
Win / UWP / Xbox One / Game Core - Windows Audio Session API. (Default on Windows, Xbox One, Game Core and UWP)
FMOD_OUTPUTTYPE_ASIO
Win - Low latency ASIO 2.0.
FMOD_OUTPUTTYPE_PULSEAUDIO
Linux - Pulse Audio. (Default on Linux if available)
FMOD_OUTPUTTYPE_ALSA
Linux - Advanced Linux Sound Architecture. (Default on Linux if PulseAudio isn't available)
FMOD_OUTPUTTYPE_COREAUDIO
Mac / iOS - Core Audio. (Default on Mac and iOS)
FMOD_OUTPUTTYPE_AUDIOTRACK
Android - Java Audio Track. (Default on Android 2.2 and below)
FMOD_OUTPUTTYPE_OPENSL
Android - OpenSL ES. (Default on Android 2.3 up to 7.1)
FMOD_OUTPUTTYPE_AUDIOOUT
PS4 / PS5 - Audio Out. (Default on PS4, PS5)
FMOD_OUTPUTTYPE_AUDIO3D
PS4 - Audio3D.
FMOD_OUTPUTTYPE_WEBAUDIO
HTML5 - Web Audio ScriptProcessorNode output. (Default on HTML5 if AudioWorkletNode isn't available)
FMOD_OUTPUTTYPE_NNAUDIO
Switch - nn::audio. (Default on Switch)
FMOD_OUTPUTTYPE_WINSONIC
Win10 / Xbox One / Game Core - Windows Sonic.
FMOD_OUTPUTTYPE_AAUDIO
Android - AAudio. (Default on Android 8.1 and above)
FMOD_OUTPUTTYPE_AUDIOWORKLET
HTML5 - Web Audio AudioWorkletNode output. (Default on HTML5 if available)
FMOD_OUTPUTTYPE_PHASE
iOS - PHASE framework. (Disabled)
FMOD_OUTPUTTYPE_OHAUDIO
OpenHarmony - OHAudio.
FMOD_OUTPUTTYPE_MAX
Maximum number of output types supported.

To pass information to the driver when initializing use the extradriverdata parameter in System::init for the following reasons:

Currently these are the only FMOD drivers that take extra information. Other unknown plug-ins may have different requirements.

If FMOD_OUTPUTTYPE_WAVWRITER_NRT or FMOD_OUTPUTTYPE_NOSOUND_NRT are used, and if the System::update function is being called very quickly (ie for a non realtime decode) it may be being called too quickly for the FMOD streamer thread to respond to. The result will be a skipping/stuttering output in the captured audio. To remedy this, disable the FMOD streamer thread, and use FMOD_INIT_STREAM_FROM_UPDATE to avoid skipping in the output stream, as it will lock the mixer and the streamer together in the same thread.

See Also: System::setOutput, System::getOutput

FMOD_PLUGINLIST

Used to support lists of plug-ins within the one dynamic library.

C
C++
C#
JS

typedef struct FMOD_PLUGINLIST {
  FMOD_PLUGINTYPE  type;
  void            *description;
} FMOD_PLUGINLIST;

Not supported for C#.

Not supported for JavaScript.

type R/O
Plug-in type. (FMOD_PLUGINTYPE)
description R/O
One of the plug-in description structures. (FMOD_DSP_DESCRIPTION) (FMOD_OUTPUT_DESCRIPTION) (FMOD_CODEC_DESCRIPTION).

This structure is returned from a plugin as a pointer to a list where the last entry has FMOD_PLUGINTYPE_MAX and a NULL description.

See Also: System::getNumNestedPlugins, System::getNestedPlugin

FMOD_PLUGINTYPE

Types of plug-in used to extend functionality.

C
C++
C#
JS

typedef enum FMOD_PLUGINTYPE {
  FMOD_PLUGINTYPE_OUTPUT,
  FMOD_PLUGINTYPE_CODEC,
  FMOD_PLUGINTYPE_DSP,
  FMOD_PLUGINTYPE_MAX
} FMOD_PLUGINTYPE;
enum PLUGINTYPE : int
{
  OUTPUT,
  CODEC,
  DSP,
  MAX
}
PLUGINTYPE_OUTPUT
PLUGINTYPE_CODEC
PLUGINTYPE_DSP
PLUGINTYPE_MAX
FMOD_PLUGINTYPE_OUTPUT
Audio output interface plug-in represented with FMOD_OUTPUT_DESCRIPTION.
FMOD_PLUGINTYPE_CODEC
File format codec plug-in represented with FMOD_CODEC_DESCRIPTION.
FMOD_PLUGINTYPE_DSP
DSP unit plug-in represented with FMOD_DSP_DESCRIPTION.
FMOD_PLUGINTYPE_MAX
Maximum number of plug-in types supported.

See Also: System::getNumPlugins, System::getPluginInfo, System::unloadPlugin

FMOD_PORT_INDEX

Output type specific index for when there are multiple instances or destinations for a port type.

C
C++
C#
JS

#define FMOD_PORT_INDEX_NONE 0xFFFFFFFFFFFFFFFF
struct PORT_INDEX
{
  const ulong NONE = 0xFFFFFFFFFFFFFFFF;
}
PORT_INDEX_NONE = 0xFFFFFFFFFFFFFFFF
FMOD_PORT_INDEX_NONE
Use when a port index is not required

See Also: System::attachChannelGroupToPort, FMOD_PORT_TYPE

FMOD_PORT_TYPE

Port types available for routing audio.

C
C++
C#
JS

typedef enum FMOD_PORT_TYPE
{
    FMOD_PORT_TYPE_MUSIC,
    FMOD_PORT_TYPE_COPYRIGHT_MUSIC,
    FMOD_PORT_TYPE_VOICE,
    FMOD_PORT_TYPE_CONTROLLER,
    FMOD_PORT_TYPE_PERSONAL,
    FMOD_PORT_TYPE_VIBRATION,
    FMOD_PORT_TYPE_AUX,
    FMOD_PORT_TYPE_PASSTHROUGH,
    FMOD_PORT_TYPE_VR_VIBRATION,
    FMOD_PORT_TYPE_MAX
} FMOD_PORT_TYPE;
enum PORT_TYPE : int
{
    MUSIC,
    COPYRIGHT_MUSIC,
    VOICE,
    CONTROLLER,
    PERSONAL,
    VIBRATION,
    AUX,
    PASSTHROUGH,
    VR_VIBRATION,
    MAX
}
PORT_TYPE_MUSIC
PORT_TYPE_COPYRIGHT_MUSIC
PORT_TYPE_VOICE
PORT_TYPE_CONTROLLER
PORT_TYPE_PERSONAL
PORT_TYPE_VIBRATION
PORT_TYPE_AUX
PORT_TYPE_PASSTHROUGH
PORT_TYPE_VR_VIBRATION
PORT_TYPE_MAX
FMOD_PORT_TYPE_MUSIC
Background music, pass FMOD_PORT_INDEX_NONE as port index.
Copyright background music, pass FMOD_PORT_INDEX_NONE as port index.
FMOD_PORT_TYPE_VOICE
Voice chat, pass platform specific user ID of desired user as port index.
FMOD_PORT_TYPE_CONTROLLER
Controller speaker, pass platform specific user ID of desired user as port index.
FMOD_PORT_TYPE_PERSONAL
Personal audio device, pass platform specific user ID of desired user as port index.
FMOD_PORT_TYPE_VIBRATION
Controller vibration, pass platform specific user ID of desired user as port index.
FMOD_PORT_TYPE_AUX
Auxiliary output port, pass FMOD_PORT_INDEX_NONE as port index.
FMOD_PORT_TYPE_PASSTHROUGH
Passthrough output port, pass FMOD_PORT_INDEX_NONE as port index.
FMOD_PORT_TYPE_VR_VIBRATION
VR Controller vibration, pass platform specific user ID of desired user as port index.
FMOD_PORT_TYPE_MAX
Maximum number of port types supported.

Not all platforms support all port types. See platform specific guides for a list of supported port types on each platform.

See Also: System::attachChannelGroupToPort

FMOD_REVERB_MAXINSTANCES

The maximum number of global reverb instances.

C
C++
C#
JS

#define FMOD_REVERB_MAXINSTANCES 4
class CONSTANTS
{
  const int REVERB_MAXINSTANCES = 4;
}
REVERB_MAXINSTANCES = 4
FMOD_REVERB_MAXINSTANCES
Maximum instances available.

Each instance of a reverb is an instance of an FMOD_DSP_SFXREVERB DSP in the DSP graph. This is unrelated to the number of possible Reverb3D objects, which is unlimited.

See Also: ChannelControl::setReverbProperties, ChannelControl::setReverbProperties, System::setReverbProperties, System::getReverbProperties

FMOD_REVERB_PRESETS

Predefined reverb configurations. To simplify usage, and avoid manually selecting reverb parameters, a table of common presets is supplied for ease of use.

C
C++
C#
JS

#define FMOD_PRESET_OFF                {  1000,    7,  11, 5000, 100, 100, 100, 250, 0,    20,  96, -80.0f }
#define FMOD_PRESET_GENERIC            {  1500,    7,  11, 5000,  83, 100, 100, 250, 0, 14500,  96,  -8.0f }
#define FMOD_PRESET_PADDEDCELL         {   170,    1,   2, 5000,  10, 100, 100, 250, 0,   160,  84,  -7.8f }
#define FMOD_PRESET_ROOM               {   400,    2,   3, 5000,  83, 100, 100, 250, 0,  6050,  88,  -9.4f }
#define FMOD_PRESET_BATHROOM           {  1500,    7,  11, 5000,  54, 100,  60, 250, 0,  2900,  83,   0.5f }
#define FMOD_PRESET_LIVINGROOM         {   500,    3,   4, 5000,  10, 100, 100, 250, 0,   160,  58, -19.0f }
#define FMOD_PRESET_STONEROOM          {  2300,   12,  17, 5000,  64, 100, 100, 250, 0,  7800,  71,  -8.5f }
#define FMOD_PRESET_AUDITORIUM         {  4300,   20,  30, 5000,  59, 100, 100, 250, 0,  5850,  64, -11.7f }
#define FMOD_PRESET_CONCERTHALL        {  3900,   20,  29, 5000,  70, 100, 100, 250, 0,  5650,  80,  -9.8f }
#define FMOD_PRESET_CAVE               {  2900,   15,  22, 5000, 100, 100, 100, 250, 0, 20000,  59, -11.3f }
#define FMOD_PRESET_ARENA              {  7200,   20,  30, 5000,  33, 100, 100, 250, 0,  4500,  80,  -9.6f }
#define FMOD_PRESET_HANGAR             { 10000,   20,  30, 5000,  23, 100, 100, 250, 0,  3400,  72,  -7.4f }
#define FMOD_PRESET_CARPETTEDHALLWAY   {   300,    2,  30, 5000,  10, 100, 100, 250, 0,   500,  56, -24.0f }
#define FMOD_PRESET_HALLWAY            {  1500,    7,  11, 5000,  59, 100, 100, 250, 0,  7800,  87,  -5.5f }
#define FMOD_PRESET_STONECORRIDOR      {   270,   13,  20, 5000,  79, 100, 100, 250, 0,  9000,  86,  -6.0f }
#define FMOD_PRESET_ALLEY              {  1500,    7,  11, 5000,  86, 100, 100, 250, 0,  8300,  80,  -9.8f }
#define FMOD_PRESET_FOREST             {  1500,  162,  88, 5000,  54,  79, 100, 250, 0,   760,  94, -12.3f }
#define FMOD_PRESET_CITY               {  1500,    7,  11, 5000,  67,  50, 100, 250, 0,  4050,  66, -26.0f }
#define FMOD_PRESET_MOUNTAINS          {  1500,  300, 100, 5000,  21,  27, 100, 250, 0,  1220,  82, -24.0f }
#define FMOD_PRESET_QUARRY             {  1500,   61,  25, 5000,  83, 100, 100, 250, 0,  3400, 100,  -5.0f }
#define FMOD_PRESET_PLAIN              {  1500,  179, 100, 5000,  50,  21, 100, 250, 0,  1670,  65, -28.0f }
#define FMOD_PRESET_PARKINGLOT         {  1700,    8,  12, 5000, 100, 100, 100, 250, 0, 20000,  56, -19.5f }
#define FMOD_PRESET_SEWERPIPE          {  2800,   14,  21, 5000,  14,  80,  60, 250, 0,  3400,  66,   1.2f }
#define FMOD_PRESET_UNDERWATER         {  1500,    7,  11, 5000,  10, 100, 100, 250, 0,   500,  92,   7.0f }
class PRESET
{
  REVERB_PROPERTIES OFF
  REVERB_PROPERTIES GENERIC
  REVERB_PROPERTIES PADDEDCELL
  REVERB_PROPERTIES ROOM
  REVERB_PROPERTIES BATHROOM
  REVERB_PROPERTIES LIVINGROOM
  REVERB_PROPERTIES STONEROOM
  REVERB_PROPERTIES AUDITORIUM
  REVERB_PROPERTIES CONCERTHALL
  REVERB_PROPERTIES CAVE
  REVERB_PROPERTIES ARENA
  REVERB_PROPERTIES HANGAR
  REVERB_PROPERTIES CARPETTEDHALLWAY
  REVERB_PROPERTIES HALLWAY
  REVERB_PROPERTIES STONECORRIDOR
  REVERB_PROPERTIES ALLEY
  REVERB_PROPERTIES FOREST
  REVERB_PROPERTIES CITY
  REVERB_PROPERTIES MOUNTAINS
  REVERB_PROPERTIES QUARRY
  REVERB_PROPERTIES PLAIN
  REVERB_PROPERTIES PARKINGLOT
  REVERB_PROPERTIES SEWERPIPE
  REVERB_PROPERTIES UNDERWATER
}

Not supported for JavaScript.

FMOD_PRESET_OFF
Off / disabled
FMOD_PRESET_GENERIC
Generic / default
FMOD_PRESET_PADDEDCELL
Padded cell
FMOD_PRESET_ROOM
Room
FMOD_PRESET_BATHROOM
Bathroom
FMOD_PRESET_LIVINGROOM
Living room
FMOD_PRESET_STONEROOM
Stone room
FMOD_PRESET_AUDITORIUM
Auditorium
FMOD_PRESET_CONCERTHALL
Convert hall
FMOD_PRESET_CAVE
Cave
FMOD_PRESET_ARENA
Arena
FMOD_PRESET_HANGAR
Hangar
FMOD_PRESET_CARPETTEDHALLWAY
Carpeted hallway
FMOD_PRESET_HALLWAY
Hallway
FMOD_PRESET_STONECORRIDOR
Stone corridor
FMOD_PRESET_ALLEY
Alley
FMOD_PRESET_FOREST
Forest
FMOD_PRESET_CITY
City
FMOD_PRESET_MOUNTAINS
Mountains
FMOD_PRESET_QUARRY
Quarry
FMOD_PRESET_PLAIN
Plain
FMOD_PRESET_PARKINGLOT
Parking lot
FMOD_PRESET_SEWERPIPE
Sewer pipe
FMOD_PRESET_UNDERWATER
Underwater

Sets of predefined reverb properties used to initialize an FMOD_REVERB_PROPERTIES structure statically.
For example:

FMOD_REVERB_PROPERTIES prop = FMOD_PRESET_GENERIC;

See Also: System::setReverbProperties, System::getReverbProperties

FMOD_REVERB_PROPERTIES

Structure defining a reverb environment.

C
C++
C#
JS

typedef struct FMOD_REVERB_PROPERTIES {
  float   DecayTime;
  float   EarlyDelay;
  float   LateDelay;
  float   HFReference;
  float   HFDecayRatio;
  float   Diffusion;
  float   Density;
  float   LowShelfFrequency;
  float   LowShelfGain;
  float   HighCut;
  float   EarlyLateMix;
  float   WetLevel;
} FMOD_REVERB_PROPERTIES;
struct REVERB_PROPERTIES
{
    float DecayTime;
    float EarlyDelay;
    float LateDelay;
    float HFReference;
    float HFDecayRatio;
    float Diffusion;
    float Density;
    float LowShelfFrequency;
    float LowShelfGain;
    float HighCut;
    float EarlyLateMix;
    float WetLevel;
}
REVERB_PROPERTIES
{
  DecayTime,
  EarlyDelay,
  LateDelay,
  HFReference,
  HFDecayRatio,
  Diffusion,
  Density,
  LowShelfFrequency,
  LowShelfGain,
  HighCut,
  EarlyLateMix,
  WetLevel,
};
DecayTime

Reverberation decay time.

  • Units: Milliseconds
  • Default: 1500
  • Range: [0, 20000]
EarlyDelay

Initial reflection delay time.

  • Units: Milliseconds
  • Default: 7
  • Range: [0, 300]
LateDelay

Late reverberation delay time relative to initial reflection.

  • Units: Milliseconds
  • Default: 11
  • Range: [0, 100]
HFReference

Reference high frequency.

  • Units: Hertz
  • Default: 5000
  • Range: [20, 20000]
HFDecayRatio

High-frequency to mid-frequency decay time ratio.

  • Units: Percent
  • Default: 50
  • Range: [10, 100]
Diffusion

Value that controls the echo density in the late reverberation decay.

  • Units: Percent
  • Default: 50
  • Range: [10, 100]
Density

Value that controls the modal density in the late reverberation decay.

  • Units: Percent
  • Default: 100
  • Range: [0, 100]
LowShelfFrequency

Reference low frequency

  • Units: Hertz
  • Default: 250
  • Range: [20, 1000]
LowShelfGain

Relative room effect level at low frequencies.

  • Units: Decibels
  • Default: 0
  • Range: [-36, 12]
HighCut

Relative room effect level at high frequencies.

  • Units: Hertz
  • Default: 200000
  • Range: [0, 20000]
EarlyLateMix

Early reflections level relative to room effect.

  • Units: Percent
  • Default: 50
  • Range: [0, 100]
WetLevel

Room effect level at mid frequencies.

  • Units: Decibels
  • Default: -6
  • Range: [-80, 20]

Note the default reverb properties are the same as the FMOD_PRESET_GENERIC preset.

See Also: System::setReverbProperties, System::getReverbProperties, FMOD_REVERB_PRESETS

System::attachChannelGroupToPort

Connect the output of the specified ChannelGroup to an audio port on the output driver.

C
C++
C#
JS

FMOD_RESULT System::attachChannelGroupToPort(
  FMOD_PORT_TYPE portType,
  FMOD_PORT_INDEX portIndex,
  ChannelGroup *channelgroup,
  bool passThru = false
);
FMOD_RESULT FMOD_System_AttachChannelGroupToPort(
  FMOD_SYSTEM *system,
  FMOD_PORT_TYPE portType,
  FMOD_PORT_INDEX portIndex,
  FMOD_CHANNELGROUP *channelgroup,
  FMOD_BOOL passThru
);
RESULT System.attachChannelGroupToPort(
  uint portType,
  ulong portIndex,
  ChannelGroup channelgroup,
  bool passThru = false
);
System.attachChannelGroupToPort(
  portType,
  portIndex,
  channelgroup,
  passThru
);
portType
Port type (output mode specific). (FMOD_PORT_TYPE)
portIndex
Index to specify which instance of the specified portType to use (output mode specific) (FMOD_PORT_INDEX)
channelgroup
Group to attach the port to. (ChannelGroup)
passThru

Whether the signal should additionally route to the existing ChannelGroup output.

  • Units: Boolean

Ports are additional outputs supported by some FMOD_OUTPUTTYPE plug-ins and can include things like controller headsets or dedicated background music streams. See the Port Support section (where applicable) of each platform's getting started guide found in the platform details chapter.

See Also: System::detachChannelGroupFromPort

System::attachFileSystem

'Piggyback' on FMOD file reading routines to capture data as it's read.

This allows users to capture data as FMOD reads it, which may be useful for extracting the raw data that FMOD reads for hard to support sources (for example internet streams).

C
C++
C#
JS

FMOD_RESULT System::attachFileSystem(
  FMOD_FILE_OPEN_CALLBACK useropen,
  FMOD_FILE_CLOSE_CALLBACK userclose,
  FMOD_FILE_READ_CALLBACK userread,
  FMOD_FILE_SEEK_CALLBACK userseek
);
FMOD_RESULT FMOD_System_AttachFileSystem(
  FMOD_SYSTEM *system,
  FMOD_FILE_OPEN_CALLBACK useropen,
  FMOD_FILE_CLOSE_CALLBACK userclose,
  FMOD_FILE_READ_CALLBACK userread,
  FMOD_FILE_SEEK_CALLBACK userseek
);
RESULT System.attachFileSystem(
  FILE_OPENCALLBACK useropen,
  FILE_CLOSECALLBACK userclose,
  FILE_READCALLBACK userread,
  FILE_SEEKCALLBACK userseek
);
System.attachFileSystem(
  useropen,
  userclose,
  userread,
  userseek
);
useropen Opt
Callback for after a file is opened. (FMOD_FILE_OPEN_CALLBACK)
userclose Opt
Callback for after a file is closed. (FMOD_FILE_CLOSE_CALLBACK)
userread Opt
Callback for after a read operation. (FMOD_FILE_READ_CALLBACK)
userseek Opt
Callback for after a seek operation. (FMOD_FILE_SEEK_CALLBACK)

To detach, pass null or equivalent as the callback parameters.

Note: This function is not to replace FMOD's file system. For this functionality, see System::setFileSystem.

See Also: Callback Behavior

FMOD_SYSTEM_CALLBACK

Callback for System notifications.

C
C++
C#
JS

FMOD_RESULT F_CALL FMOD_SYSTEM_CALLBACK(
  FMOD_SYSTEM *system,
  FMOD_SYSTEM_CALLBACK_TYPE type,
  void *commanddata1,
  void *commanddata2,
  void *userdata
);
delegate RESULT SYSTEM_CALLBACK(
  IntPtr system,
  SYSTEM_CALLBACK_TYPE type,
  IntPtr commanddata1,
  IntPtr commanddata2,
  IntPtr userdata
);
function FMOD_SYSTEM_CALLBACK(
  system,
  type,
  commanddata1,
  commanddata2,
  userdata
)
system Opt
System handle. (System)
type
Type of callback. (FMOD_SYSTEM_CALLBACK_TYPE)
commanddata1 Opt
First callback parameter, see FMOD_SYSTEM_CALLBACK_TYPE for details.
commanddata2 Opt
Second callback parameter, see FMOD_SYSTEM_CALLBACK_TYPE for details.
userdata Opt
User data associated with system or the last value set with any call to System::setUserData for global callbacks.

The 'system' argument can be cast to FMOD::System *.

The 'system' argument can be used via System by using FMOD.System coreSystem = new FMOD.System(system);

See Also: Callback Behavior, User Data, System::setCallback

FMOD_SYSTEM_CALLBACK_TYPE

Types of callbacks called by the System.

C
C++
C#
JS

#define FMOD_SYSTEM_CALLBACK_DEVICELISTCHANGED        0x00000001
#define FMOD_SYSTEM_CALLBACK_DEVICELOST               0x00000002
#define FMOD_SYSTEM_CALLBACK_MEMORYALLOCATIONFAILED   0x00000004
#define FMOD_SYSTEM_CALLBACK_THREADCREATED            0x00000008
#define FMOD_SYSTEM_CALLBACK_BADDSPCONNECTION         0x00000010
#define FMOD_SYSTEM_CALLBACK_PREMIX                   0x00000020
#define FMOD_SYSTEM_CALLBACK_POSTMIX                  0x00000040
#define FMOD_SYSTEM_CALLBACK_ERROR                    0x00000080
#define FMOD_SYSTEM_CALLBACK_THREADDESTROYED          0x00000100
#define FMOD_SYSTEM_CALLBACK_PREUPDATE                0x00000200
#define FMOD_SYSTEM_CALLBACK_POSTUPDATE               0x00000400
#define FMOD_SYSTEM_CALLBACK_RECORDLISTCHANGED        0x00000800
#define FMOD_SYSTEM_CALLBACK_BUFFEREDNOMIX            0x00001000
#define FMOD_SYSTEM_CALLBACK_DEVICEREINITIALIZE       0x00002000
#define FMOD_SYSTEM_CALLBACK_OUTPUTUNDERRUN           0x00004000
#define FMOD_SYSTEM_CALLBACK_RECORDPOSITIONCHANGED    0x00008000
#define FMOD_SYSTEM_CALLBACK_ALL                      0xFFFFFFFF
[Flags]
enum SYSTEM_CALLBACK_TYPE : uint
{
  DEVICELISTCHANGED      = 0x00000001,
  DEVICELOST             = 0x00000002,
  MEMORYALLOCATIONFAILED = 0x00000004,
  THREADCREATED          = 0x00000008,
  BADDSPCONNECTION       = 0x00000010,
  PREMIX                 = 0x00000020,
  POSTMIX                = 0x00000040,
  ERROR                  = 0x00000080,
  THREADDESTROYED        = 0x00000100,
  PREUPDATE              = 0x00000200,
  POSTUPDATE             = 0x00000400,
  RECORDLISTCHANGED      = 0x00000800,
  BUFFEREDNOMIX          = 0x00001000,
  DEVICEREINITIALIZE     = 0x00002000,
  OUTPUTUNDERRUN         = 0x00004000,
  RECORDPOSITIONCHANGED  = 0x00008000,
  ALL                    = 0xFFFFFFFF,
}
SYSTEM_CALLBACK_DEVICELISTCHANGED      = 0x00000001
SYSTEM_CALLBACK_DEVICELOST             = 0x00000002
SYSTEM_CALLBACK_MEMORYALLOCATIONFAILED = 0x00000004
SYSTEM_CALLBACK_THREADCREATED          = 0x00000008
SYSTEM_CALLBACK_BADDSPCONNECTION       = 0x00000010
SYSTEM_CALLBACK_PREMIX                 = 0x00000020
SYSTEM_CALLBACK_POSTMIX                = 0x00000040
SYSTEM_CALLBACK_ERROR                  = 0x00000080
SYSTEM_CALLBACK_THREADDESTROYED        = 0x00000100
SYSTEM_CALLBACK_PREUPDATE              = 0x00000200
SYSTEM_CALLBACK_POSTUPDATE             = 0x00000400
SYSTEM_CALLBACK_RECORDLISTCHANGED      = 0x00000800
SYSTEM_CALLBACK_BUFFEREDNOMIX          = 0x00001000
SYSTEM_CALLBACK_DEVICEREINITIALIZE     = 0x00002000
SYSTEM_CALLBACK_OUTPUTUNDERRUN         = 0x00004000
SYSTEM_CALLBACK_RECORDPOSITIONCHANGED  = 0x00008000
SYSTEM_CALLBACK_ALL                    = 0xFFFFFFFF
FMOD_SYSTEM_CALLBACK_DEVICELISTCHANGED
Called from System::update when the enumerated list of devices has changed. Called from the main (calling) thread when set from the Core API or Studio API in synchronous mode, and from the Studio Update Thread when in default / async mode.
FMOD_SYSTEM_CALLBACK_DEVICELOST
Deprecated.
FMOD_SYSTEM_CALLBACK_MEMORYALLOCATIONFAILED
Called directly when a memory allocation fails.
FMOD_SYSTEM_CALLBACK_THREADCREATED
Called from the game thread when a thread is created.
FMOD_SYSTEM_CALLBACK_BADDSPCONNECTION
Deprecated.
FMOD_SYSTEM_CALLBACK_PREMIX
Called from the mixer thread before it starts the next block.
FMOD_SYSTEM_CALLBACK_POSTMIX
Called from the mixer thread after it finishes a block.
FMOD_SYSTEM_CALLBACK_ERROR
Called directly when an API function returns an error, including delayed async functions.
FMOD_SYSTEM_CALLBACK_THREADDESTROYED
Called from the game thread when a thread is destroyed.
FMOD_SYSTEM_CALLBACK_PREUPDATE
Called at start of System::update from the main (calling) thread when set from the Core API or Studio API in synchronous mode, and from the Studio Update Thread when in default / async mode.
FMOD_SYSTEM_CALLBACK_POSTUPDATE
Called at end of System::update from the main (calling) thread when set from the Core API or Studio API in synchronous mode, and from the Studio Update Thread when in default / async mode.
FMOD_SYSTEM_CALLBACK_RECORDLISTCHANGED
Called from System::update when the enumerated list of recording devices has changed. Called from the main (calling) thread when set from the Core API or Studio API in synchronous mode, and from the Studio Update Thread when in default / async mode.
FMOD_SYSTEM_CALLBACK_BUFFEREDNOMIX
Called from the feeder thread after audio was consumed from the ring buffer, but not enough to allow another mix to run.
FMOD_SYSTEM_CALLBACK_DEVICEREINITIALIZE
Called from System::update when an output device is re-initialized. Called from the main (calling) thread when set from the Core API or Studio API in synchronous mode, and from the Studio Update Thread when in default / async mode.
FMOD_SYSTEM_CALLBACK_OUTPUTUNDERRUN
Called from the mixer thread when the device output attempts to read more samples than are available in the output buffer.
FMOD_SYSTEM_CALLBACK_RECORDPOSITIONCHANGED
Called from the mixer thread when the System record position changed.
FMOD_SYSTEM_CALLBACK_ALL
Mask representing all callback types.

For each callback type unless specified below it is assumed commanddata1 and commanddata2 are unused and userdata matches the value set with System::setUserData.

FMOD_SYSTEM_CALLBACK_MEMORYALLOCATIONFAILED
commanddata1: (const char *) representing the file and line of the failure.
commanddata2: (int) representing the size of the requested allocation

FMOD_SYSTEM_CALLBACK_ERROR
commanddata1: (FMOD_ERRORCALLBACK_INFO *) with extra information about the error.
commanddata2: Unused.

FMOD_SYSTEM_CALLBACK_THREADCREATED / FMOD_SYSTEM_CALLBACK_THREADDESTROYED
commanddata1: Handle of the thread, see notes below for thread handle types.
commanddata2: (const char *) representing the name of the thread.

FMOD_SYSTEM_CALLBACK_DEVICEREINITIALIZE
commanddata1: (FMOD_OUTPUTTYPE) of the output device.
commanddata2: (int) selected driver index.

FMOD_SYSTEM_CALLBACK_RECORDPOSITIONCHANGED
commanddata1: (Sound) that is being recorded to.
commanddata2: (int) The new record position.

Thread handle types per platform:

Using FMOD_SYSTEM_CALLBACK_ALL or FMOD_SYSTEM_CALLBACK_DEVICELISTCHANGED will disable any automated device ejection/insertion handling. Use this callback to control the behavior yourself.
Using FMOD_SYSTEM_CALLBACK_DEVICELISTCHANGED (Mac only) requires the application to be running an event loop which will allow external changes to device list to be detected.

See Also: Callback Behavior, System::setCallback, FMOD_SYSTEM_CALLBACK

System::close

Close the connection to the output and return to an uninitialized state without releasing the object.

C
C++
C#
JS

FMOD_RESULT System::close();
FMOD_RESULT FMOD_System_Close(FMOD_SYSTEM *system);
RESULT System.close();
System.close();

Closing renders objects created with this System invalid. Make sure any Sound, ChannelGroup, Geometry and DSP objects are released before calling this.

All pre-initialize configuration settings will remain and the System can be reinitialized as needed.

See Also: System::init, System::release

System_Create

Creates an instance of the FMOD system.

C
C++
C#
JS

FMOD_RESULT System_Create(
  System **system,
  unsigned int headerversion = FMOD_VERSION
);
FMOD_RESULT FMOD_System_Create(
  FMOD_SYSTEM **system,
  unsigned int headerversion
);
static RESULT Factory.System_Create(
  out System system
);
System_Create(
  system
);
system Out
Newly created object. (System)
headerversion
Expected FMOD Engine version.

Pass FMOD_VERSION in headerversion to ensure the library and header versions being used match.

This must be called first to create an FMOD System object before any other API calls (except for Memory_Initialize and Debug_Initialize). Use this function to create 1 or multiple instances of FMOD System objects.

Use System::release to free a system object.

Calls to System_Create and System::release are not thread-safe. Do not call these functions simultaneously from multiple threads at once.

See Also: System::init

System::createChannelGroup

Create a ChannelGroup object.

C
C++
C#
JS

FMOD_RESULT System::createChannelGroup(
  const char *name,
  ChannelGroup **channelgroup
);
FMOD_RESULT FMOD_System_CreateChannelGroup(
  FMOD_SYSTEM *system,
  const char *name,
  FMOD_CHANNELGROUP **channelgroup
);
RESULT System.createChannelGroup(
  string name,
  out ChannelGroup channelgroup
);
System.createChannelGroup(
  name,
  channelgroup
);
name Opt
Label for identification purposes. (UTF-8 string)
channelgroup Out
Newly created group. (ChannelGroup)

ChannelGroups can be used to assign / group Channels, for things such as volume scaling. ChannelGroups are also used for sub-mixing. Any Channels that are assigned to a ChannelGroup get submixed into that ChannelGroup's 'tail' DSP. See FMOD_CHANNELCONTROL_DSP_TAIL.

If a ChannelGroup has an effect added to it, the effect is processed post-mix from the Channels and ChannelGroups below it in the mix hierarchy. See the DSP architecture guide for more information.

All ChannelGroups will initially output directly to the master ChannelGroup (See System::getMasterChannelGroup). ChannelGroups can be re-parented this with ChannelGroup::addGroup.

See Also: ChannelGroup::release

System::createDSP

Create a DSP unit given a plug-in description structure.

C
C++
C#
JS

FMOD_RESULT System::createDSP(
  const FMOD_DSP_DESCRIPTION *description,
  DSP **dsp
);
FMOD_RESULT FMOD_System_CreateDSP(
  FMOD_SYSTEM *system,
  const FMOD_DSP_DESCRIPTION *description,
  FMOD_DSP **dsp
);
RESULT System.createDSP(
  ref DSP_DESCRIPTION description,
  out DSP dsp
);
System.createDSP(
  description,
  dsp
);
description
Structure describing the DSP to create. (FMOD_DSP_DESCRIPTION)
dsp Out
Newly created unit. (DSP)

A DSP unit is a module that can be inserted into the DSP graph to allow sound filtering or sound generation. See the DSP architecture guide for more information.

DSPs must be attached to the DSP graph before they become active, either via ChannelControl::addDSP or DSP::addInput.

See Also: System::createDSPByType, System::createDSPByPlugin

System::createDSPByPlugin

Create a DSP unit with a specified plug-in handle.

C
C++
C#
JS

FMOD_RESULT System::createDSPByPlugin(
  unsigned int handle,
  DSP **dsp
);
FMOD_RESULT FMOD_System_CreateDSPByPlugin(
  FMOD_SYSTEM *system,
  unsigned int handle,
  FMOD_DSP **dsp
);
RESULT System.createDSPByPlugin(
  uint handle,
  out DSP dsp
);
System.createDSPByPlugin(
  handle,
  dsp
);
handle
Handle to an already loaded DSP plug-in.
dsp Out
Newly created unit. (DSP)

A DSP object is a module that can be inserted into the DSP graph to allow sound filtering or sound generation. See the DSP architecture guide for more information.

A handle can come from a newly loaded plug-in with System::loadPlugin or an existing plug-in with System::getPluginHandle.

DSPs must be attached to the DSP graph before they become active, either via ChannelControl::addDSP or DSP::addInput.

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

System::createDSPByType

Create a DSP unit with a specified built-in type index.

C
C++
C#
JS

FMOD_RESULT System::createDSPByType(
  FMOD_DSP_TYPE type,
  DSP **dsp
);
FMOD_RESULT FMOD_System_CreateDSPByType(
  FMOD_SYSTEM *system,
  FMOD_DSP_TYPE type,
  FMOD_DSP **dsp
);
RESULT System.createDSPByType(
  DSP_TYPE type,
  out DSP dsp
);
System.createDSPByType(
  type,
  dsp
);
type
Type of built in unit. (FMOD_DSP_TYPE)
dsp Out
Newly created unit. (DSP)

A DSP unit (or "DSP") is a module that can be inserted into the DSP graph to allow sound filtering or sound generation. See the DSP architecture guide for more information.

DSPs must be attached to the DSP graph before they become active, either via ChannelControl::addDSP or DSP::addInput.

See Also: System::createDSP

System::createGeometry

Geometry creation function. This function will create a base geometry object which can then have polygons added to it.

C
C++
C#
JS

FMOD_RESULT System::createGeometry(
  int maxpolygons,
  int maxvertices,
  Geometry **geometry
);
FMOD_RESULT FMOD_System_CreateGeometry(
  FMOD_SYSTEM *system,
  int maxpolygons,
  int maxvertices,
  FMOD_GEOMETRY **geometry
);
RESULT System.createGeometry(
  int maxpolygons,
  int maxvertices,
  out Geometry geometry
);
System.createGeometry(
  maxpolygons,
  maxvertices,
  geometry
);
maxpolygons
Maximum number of polygons within this object.
maxvertices
Maximum number of vertices within this object.
geometry Out
Newly created geometry object. (Geometry)

Polygons can be added to a geometry object using Geometry::addPolygon. For best efficiency, avoid overlapping of polygons and long thin polygons.

A geometry object stores its polygons in a group to allow optimization for line testing, insertion and updating of geometry in real-time.
Geometry objects also allow for efficient rotation, scaling and translation of groups of polygons.

It is important to set the value of maxworldsize to an appropriate value using System::setGeometrySettings.

See Also: System::setGeometrySettings, System::loadGeometry, Geometry::addPolygon, Geometry::setPosition, Geometry::setRotation, Geometry::setScale

System::createReverb3D

Creates a 'virtual reverb' object. This object reacts to 3D location and morphs the reverb environment based on how close it is to the reverb object's center.

Multiple reverb objects can be created to achieve a multi-reverb environment. 1 reverb object is used for all 3D reverb objects (slot 0 by default).

C
C++
C#
JS

FMOD_RESULT System::createReverb3D(
  Reverb3D **reverb
);
FMOD_RESULT FMOD_System_CreateReverb3D(
  FMOD_SYSTEM *system,
  FMOD_REVERB3D **reverb
);
RESULT System.createReverb3D(
  out Reverb3D reverb
);
System.createReverb3D(
  reverb
);
reverb Out
Newly created virtual reverb object. (Reverb3D)

The 3D reverb object is a sphere having 3D attributes (position, minimum distance, maximum distance) and reverb properties.

The properties and 3D attributes of all reverb objects collectively determine, along with the listener's position, the settings of and input gains into a single 3D reverb DSP.

When the listener is within the sphere of effect of one or more 3D reverbs, the listener's 3D reverb properties are a weighted combination of such 3D reverbs.

When the listener is outside all of the reverbs, no reverb is applied.

System::setReverbProperties can be used to create an alternative reverb that can be used for 2D and background global reverb.

To avoid this reverb interfering with the reverb slot used by the 3D reverb, 2D reverb should use a different slot id with System::setReverbProperties, otherwise FMOD_ADVANCEDSETTINGS::reverb3Dinstance can also be used to place 3D reverb on a different reverb slot.

Use ChannelControl::setReverbProperties to turn off reverb for 2D sounds (ie set wet = 0).

Creating multiple reverb objects does not impact performance. This is because these reverb objects are 'virtual reverbs': There is only one reverb DSP unit running at a time, and its parameter values are morphed to those of each virtual reverb as needed.

To remove the reverb DSP unit and the associated CPU cost, first make sure all 3D reverb objects are released. Then, call System::setReverbProperties with the 3D reverb's slot ID (0 by default) with a property point of 0 or NULL, to signal that the reverb instance should be deleted.

If a 3D reverb is still present, and System::setReverbProperties function is called to free the reverb, the 3D reverb system recreates it upon the next System::update call.

The 3D reverb system does not affect Studio events unless it is explicitly enabled by calling Studio::EventInstance::setReverbLevel on each event instance.

See Also: Reverb3D::release

System::createSound

Loads a sound into memory, opens it for streaming or sets it up for callback based sounds.

C
C++
C#
JS

FMOD_RESULT System::createSound(
  const char *name_or_data,
  FMOD_MODE mode,
  FMOD_CREATESOUNDEXINFO *exinfo,
  Sound **sound
);
FMOD_RESULT FMOD_System_CreateSound(
  FMOD_SYSTEM *system,
  const char *name_or_data,
  FMOD_MODE mode,
  FMOD_CREATESOUNDEXINFO *exinfo,
  FMOD_SOUND **sound
);
RESULT System.createSound(
  string name,
  MODE mode,
  out Sound sound
);
RESULT System.createSound(
  byte[] data,
  MODE mode,
  out Sound sound
);
RESULT System.createSound(
  string name,
  MODE mode,
  ref CREATESOUNDEXINFO exinfo,
  out Sound sound
);
RESULT System.createSound(
  IntPtr name_or_data,
  MODE mode,
  ref CREATESOUNDEXINFO exinfo,
  out Sound sound
);
System.createSound(
  name_or_data,
  mode,
  exinfo,
  sound
);
name_or_data
Name of the file or URL to open (UTF-8 string) or a pointer to a preloaded sound memory block if FMOD_OPENMEMORY / FMOD_OPENMEMORY_POINT is used.
mode

Behavior modifier for opening the sound. (FMOD_MODE)

exinfo Opt
Extended information for creating the sound. (FMOD_CREATESOUNDEXINFO)
sound Out
Newly created Sound object. (Sound)

FMOD_CREATESAMPLE will try to load and decompress the whole sound into memory, use FMOD_CREATESTREAM to open it as a stream and have it play back in realtime from disk or another medium. FMOD_CREATECOMPRESSEDSAMPLE can also be used for certain formats to play the sound directly in its compressed format from the mixer.

Note that FMOD_OPENRAW, FMOD_OPENMEMORY, FMOD_OPENMEMORY_POINT and FMOD_OPENUSER will not work here without the exinfo structure present, as more information is needed.

Use FMOD_NONBLOCKING to have the sound open or load in the background. You can use Sound::getOpenState to determine if it has finished loading / opening or not. While it is loading (not ready), sound functions are not accessible for that sound. Do not free memory provided with FMOD_OPENMEMORY if the sound is not in a ready state, as it will most likely lead to a crash.

To account for slow media that might cause buffer underrun (skipping / stuttering / repeating blocks of audio) with sounds created with FMOD_CREATESTREAM, use System::setStreamBufferSize to increase read ahead.

As using FMOD_OPENUSER causes FMOD to ignore whatever is passed as the first argument name_or_data, recommended practice is to pass null or equivalent.

Specifying FMOD_OPENMEMORY_POINT will POINT to your memory rather allocating its own sound buffers and duplicating it internally, this means you cannot free the memory while FMOD is using it, until after Sound::release is called.

With FMOD_OPENMEMORY_POINT, only PCM formats and compressed formats using FMOD_CREATECOMPRESSEDSAMPLE are supported.

Use of FMOD.NON_BLOCKING is currently not supported for JavaScript.

System::createSoundGroup

Creates a SoundGroup object.

C
C++
C#
JS

FMOD_RESULT System::createSoundGroup(
  const char *name,
  SoundGroup **soundgroup
);
FMOD_RESULT FMOD_System_CreateSoundGroup(
  FMOD_SYSTEM *system,
  const char *name,
  FMOD_SOUNDGROUP **soundgroup
);
RESULT System.createSoundGroup(
  string name,
  out SoundGroup soundgroup
);
System.createSoundGroup(
  name,
  soundgroup
);
name
Name of SoundGroup. (UTF-8 string)
soundgroup Out
Newly created group. (SoundGroup)

A SoundGroup is a way to address multiple Sounds at once with group level commands, such as:

Once a SoundGroup is created, Sound::setSoundGroup is used to put a Sound in a SoundGroup.

See Also: SoundGroup::release, Sound::setSoundGroup

System::createStream

Opens a sound for streaming.

C
C++
C#
JS

FMOD_RESULT System::createStream(
  const char *name_or_data,
  FMOD_MODE mode,
  FMOD_CREATESOUNDEXINFO *exinfo,
  Sound **sound
);
FMOD_RESULT FMOD_System_CreateStream(
  FMOD_SYSTEM *system,
  const char *name_or_data,
  FMOD_MODE mode,
  FMOD_CREATESOUNDEXINFO *exinfo,
  FMOD_SOUND **sound
);
RESULT System.createStream(
  string name,
  MODE mode,
  out Sound sound
);
RESULT System.createStream(
  string name,
  MODE mode,
  ref CREATESOUNDEXINFO exinfo,
  out Sound sound
);
RESULT System.createStream(
  byte[] data,
  MODE mode,
  ref CREATESOUNDEXINFO exinfo,
  out Sound sound
);
RESULT System.createStream(
  IntPtr name_or_data,
  MODE mode,
  ref CREATESOUNDEXINFO exinfo,
  out Sound sound
);
System.createStream(
  name_or_data,
  mode,
  exinfo,
  sound
);
name_or_data
Name of the file or URL to open (UTF-8 string) or a pointer to a preloaded sound memory block if FMOD_OPENMEMORY / FMOD_OPENMEMORY_POINT is used.
mode

Behavior modifier for opening the sound. (FMOD_MODE)

exinfo Opt
Extended information while playing the sound. (FMOD_CREATESOUNDEXINFO)
sound Out
Newly created Sound object. (Sound)

This is a convenience function for System::createSound with the FMOD_CREATESTREAM flag added.

A stream only has one decode buffer and file handle, and therefore can only be played once. It cannot play multiple times at once because it cannot share a stream buffer if the stream is playing at different positions. Open multiple streams to have them play concurrently.

System::detachChannelGroupFromPort

Disconnect the output of the specified ChannelGroup from an audio port on the output driver.

C
C++
C#
JS

FMOD_RESULT System::detachChannelGroupFromPort(
  ChannelGroup *channelgroup
);
FMOD_RESULT FMOD_System_DetachChannelGroupFromPort(
  FMOD_SYSTEM *system,
  FMOD_CHANNELGROUP *channelgroup
);
RESULT System.detachChannelGroupFromPort(
  ChannelGroup channelgroup
);
System.detachChannelGroupFromPort(
  channelgroup
);
channelgroup
Group to detach the port from. (ChannelGroup)

Removing a ChannelGroup from a port will reroute the audio back to the main mix.

See Also: System::attachChannelGroupToPort

System::get3DListenerAttributes

Retrieves the position, velocity and orientation of the specified 3D sound listener.

C
C++
C#
JS

FMOD_RESULT System::get3DListenerAttributes(
  int listener,
  FMOD_VECTOR *pos,
  FMOD_VECTOR *vel,
  FMOD_VECTOR *forward,
  FMOD_VECTOR *up
);
FMOD_RESULT FMOD_System_Get3DListenerAttributes(
  FMOD_SYSTEM *system,
  int listener,
  FMOD_VECTOR *pos,
  FMOD_VECTOR *vel,
  FMOD_VECTOR *forward,
  FMOD_VECTOR *up
);
RESULT System.get3DListenerAttributes(
  int listener,
  out VECTOR pos,
  out VECTOR vel,
  out VECTOR forward,
  out VECTOR up
);
System.get3DListenerAttributes(
  listener,
  pos,
  vel,
  forward,
  up
);
listener

Index of listener to get 3D attributes for. Listeners are indexed from 0, to FMOD_MAX_LISTENERS - 1, in a multi-listener environment.

pos OutOpt

Position in 3D space used for panning and attenuation. (FMOD_VECTOR)

vel OutOpt

Velocity in 3D space used for doppler. (FMOD_VECTOR)

forward OutOpt
Forwards orientation. (FMOD_VECTOR)
up OutOpt
Upwards orientation. (FMOD_VECTOR)

Users of the Studio API should call Studio::System::getListenerAttributes instead of this function.

See Also: System::set3DListenerAttributes

System::get3DNumListeners

Retrieves the number of 3D listeners.

C
C++
C#
JS

FMOD_RESULT System::get3DNumListeners(
  int *numlisteners
);
FMOD_RESULT FMOD_System_Get3DNumListeners(
  FMOD_SYSTEM *system,
  int *numlisteners
);
RESULT System.get3DNumListeners(
  out int numlisteners
);
System.get3DNumListeners(
  numlisteners
);
numlisteners Out
Number of 3D listeners in the 3D scene.

Users of the Studio API should call Studio::System::getNumListeners instead of this function.

See Also: System::set3DNumListeners

System::get3DSettings

Retrieves the global doppler scale, distance factor and roll-off scale for all 3D sounds.

C
C++
C#
JS

FMOD_RESULT System::get3DSettings(
  float *dopplerscale,
  float *distancefactor,
  float *rolloffscale
);
FMOD_RESULT FMOD_System_Get3DSettings(
  FMOD_SYSTEM *system,
  float *dopplerscale,
  float *distancefactor,
  float *rolloffscale
);
RESULT System.get3DSettings(
  out float dopplerscale,
  out float distancefactor,
  out float rolloffscale
);
System.get3DSettings(
  dopplerscale,
  distancefactor,
  rolloffscale
);
dopplerscale OutOpt
A scaling factor for doppler shift.
distancefactor OutOpt
A factor for converting game distance units to FMOD distance units.
rolloffscale OutOpt
A scaling factor for distance attenuation. When a sound uses a roll-off mode other than FMOD_3D_CUSTOMROLLOFF and the distance is greater than the sound's minimum distance, the distance is scaled by the roll-off scale.

See Also: System::set3DSettings

System::getAdvancedSettings

Retrieves the advanced settings for the system object.

C
C++
C#
JS

FMOD_RESULT System::getAdvancedSettings(
  FMOD_ADVANCEDSETTINGS *settings
);
FMOD_RESULT FMOD_System_GetAdvancedSettings(
  FMOD_SYSTEM *system,
  FMOD_ADVANCEDSETTINGS *settings
);
RESULT System.getAdvancedSettings(
  ref ADVANCEDSETTINGS settings
);
System.getAdvancedSettings(
  settings
);
settings Out
Advanced settings (FMOD_ADVANCEDSETTINGS)

See Also: System::setAdvancedSettings

System::getChannel

Retrieves a handle to a Channel by ID.

C
C++
C#
JS

FMOD_RESULT System::getChannel(
  int channelid,
  Channel **channel
);
FMOD_RESULT FMOD_System_GetChannel(
  FMOD_SYSTEM *system,
  int channelid,
  FMOD_CHANNEL **channel
);
RESULT System.getChannel(
  int channelid,
  out Channel channel
);
System.getChannel(
  channelid,
  channel
);
channelid
Index in the FMOD Channel pool. Specify a Channel number from 0 to the 'maxchannels' value specified in System::init minus 1.
channel Out
Requested Channel. (Channel)

This function is mainly for getting handles to existing (playing) Channels and setting their attributes. The only way to 'create' an instance of a Channel for playback is to use System::playSound or [System::playDSP].

See Also: System::init

System::getChannelsPlaying

Retrieves the number of currently playing Channels.

C
C++
C#
JS

FMOD_RESULT System::getChannelsPlaying(
  int *channels,
  int *realchannels = nullptr
);
FMOD_RESULT FMOD_System_GetChannelsPlaying(
  FMOD_SYSTEM *system,
  int *channels,
  int *realchannels
);
RESULT System.getChannelsPlaying(
  out int channels
);
RESULT System.getChannelsPlaying(
  out int channels,
  out int realchannels
);
System.getChannelsPlaying(
  channels,
  realchannels
);
channels OptOut
Number of playing Channels (both real and virtual).
realchannels OptOut
Number of playing real (non-virtual) Channels.

For differences between real and virtual voices see the Virtual Voices guide for more information.

See Also: ChannelControl::isPlaying, Channel::isVirtual

System::getCPUUsage

Retrieves the amount of CPU used for different parts of the Core API.

C
C++
C#
JS

FMOD_RESULT System::getCPUUsage(
  FMOD_CPU_USAGE *usage
);
FMOD_RESULT FMOD_System_GetCPUUsage(
  FMOD_SYSTEM *system,
  FMOD_CPU_USAGE *usage
);
RESULT System.getCPUUsage(
  out CPU_USAGE usage
);
System.getCPUUsage(
  usage
);
usage Out
CPU usage values. (FMOD_CPU_USAGE)

For readability, the percentage values are smoothed to provide a more stable output.

See Also: Studio::System::getCPUUsage, FMOD_STUDIO_CPU_USAGE

System::getDefaultMixMatrix

Retrieves the default matrix used to convert from one speaker mode to another.

C
C++
C#
JS

FMOD_RESULT System::getDefaultMixMatrix(
  FMOD_SPEAKERMODE sourcespeakermode,
  FMOD_SPEAKERMODE targetspeakermode,
  float *matrix,
  int matrixhop
);
FMOD_RESULT FMOD_System_GetDefaultMixMatrix(
  FMOD_SYSTEM *system,
  FMOD_SPEAKERMODE sourcespeakermode,
  FMOD_SPEAKERMODE targetspeakermode,
  float *matrix,
  int matrixhop
);
RESULT System.getDefaultMixMatrix(
  SPEAKERMODE sourcespeakermode,
  SPEAKERMODE targetspeakermode,
  float[] matrix,
  int matrixhop
);
System.getDefaultMixMatrix(
  sourcespeakermode,
  targetspeakermode,
  matrix,
  matrixhop
);
sourcespeakermode
The speaker mode being converted from. (FMOD_SPEAKERMODE)
targetspeakermode
The speaker mode being converted to. (FMOD_SPEAKERMODE)
matrix Out
The output matrix. Its minimum size in number of floats must be the number of source channels multiplied by the number of target channels. Source and target channels cannot exceed FMOD_MAX_CHANNEL_WIDTH.
matrixhop Opt
The number of source channels in the matrix. If this is 0, the number of source channels will be derived from sourcespeakermode. Maximum of FMOD_MAX_CHANNEL_WIDTH.

The gain for source channel 's' to target channel 't' is matrix[t * matrixhop + s].

If 'sourcespeakermode' or 'targetspeakermode' is FMOD_SPEAKERMODE_RAW, this function will return FMOD_ERR_INVALID_PARAM.

See Also: System::getSpeakerModeChannels

System::getDriver

Retrieves the output driver for the selected output type.

C
C++
C#
JS

FMOD_RESULT System::getDriver(
  int *driver
);
FMOD_RESULT FMOD_System_GetDriver(
  FMOD_SYSTEM *system,
  int *driver
);
RESULT System.getDriver(
  out int driver
);
System.getDriver(
  driver
);
driver Out
Driver index where 0 represents the default for the output type.

See Also: System::setDriver

System::getDriverInfo

Retrieves identification information about a sound device specified by its index, and specific to the selected output mode.

C
C++
C#
JS

FMOD_RESULT System::getDriverInfo(
  int id,
  char *name,
  int namelen,
  FMOD_GUID *guid,
  int *systemrate,
  FMOD_SPEAKERMODE *speakermode,
  int *speakermodechannels
);
FMOD_RESULT FMOD_System_GetDriverInfo(
  FMOD_SYSTEM *system,
  int id,
  char *name,
  int namelen,
  FMOD_GUID *guid,
  int *systemrate,
  FMOD_SPEAKERMODE *speakermode,
  int *speakermodechannels
);
RESULT System.getDriverInfo(
  int id,
  out string name,
  int namelen,
  out Guid guid,
  out int systemrate,
  out SPEAKERMODE speakermode,
  out int speakermodechannels
);
System.getDriverInfo(
  id,
  name,
  guid,
  systemrate,
  speakermode,
  speakermodechannels
);
id

Index of the sound driver device.

name OptOut
Name of the device. (UTF-8 string)
namelen

Length of name. 256 is sufficient to contain the vast majority of driver names.

  • Units: Bytes
guid OptOut
A GUID that uniquely identifies the device. (FMOD_GUID)
systemrate OptOut
Sample rate this device operates at.
speakermode OptOut
Speaker setup this device is currently using. (FMOD_SPEAKERMODE)
speakermodechannels OptOut
Number of channels in the current speaker setup.

See Also: System::setOutput

System::getDSPBufferSize

Retrieves the buffer size settings for the FMOD software mixing engine.

C
C++
C#
JS

FMOD_RESULT System::getDSPBufferSize(
  unsigned int *bufferlength,
  int *numbuffers
);
FMOD_RESULT FMOD_System_GetDSPBufferSize(
  FMOD_SYSTEM *system,
  unsigned int *bufferlength,
  int *numbuffers
);
RESULT System.getDSPBufferSize(
  out uint bufferlength,
  out int numbuffers
);
System.getDSPBufferSize(
  bufferlength,
  numbuffers
);
bufferlength OptOut

Mixer engine block size.

  • Units: Samples
  • Default: 1024
numbuffers OptOut

Mixer engine number of buffers used.

  • Default: 4

To get the bufferlength in milliseconds, divide it by the output rate and multiply the result by 1000. For a bufferlength of 1024 and an output rate of 48khz (see System::SetSoftwareFormat), milliseconds = 1024 / 48000 * 1000 = 21.33ms. This means the mixer updates every 21.33ms.

To get the total buffer size multiply the bufferlength by the numbuffers value. By default this would be 4 * 1024 = 4096 samples, or 4 * 21.33ms = 85.33ms. This would generally be the total latency of the software mixer, but in reality due to one of the buffers being written to constantly, and the cursor position of the buffer that is audible, the latency is typically more like the (number of buffers - 1.5) multiplied by the buffer length.

To convert from milliseconds back to 'samples', simply multiply the value in milliseconds by the sample rate of the output (ie 48000 if that is what it is set to), then divide by 1000.

See Also: System::setDSPBufferSize

System::getDSPInfoByPlugin

Retrieve the description structure for a pre-existing DSP plug-in.

C
C++
C#
JS

FMOD_RESULT System::getDSPInfoByPlugin(
  unsigned int handle,
  const FMOD_DSP_DESCRIPTION **description
);
FMOD_RESULT FMOD_System_GetDSPInfoByPlugin(
  FMOD_SYSTEM *system,
  unsigned int handle,
  const FMOD_DSP_DESCRIPTION **description
);
RESULT System.getDSPInfoByPlugin(
  uint handle,
  out IntPtr description
);
System.getDSPInfoByPlugin(
  handle,
  description
);
handle
Handle to a pre-existing DSP plug-in, loaded by System::loadPlugin.
description Out
Description structure for the DSP. (FMOD_DSP_DESCRIPTION)

See Also: System::loadPlugin

System::getDSPInfoByType

Retrieve the description structure for a built-in DSP plug-in.

C
C++
C#
JS

FMOD_RESULT System::getDSPInfoByType(
  FMOD_DSP_TYPE type,
  const FMOD_DSP_DESCRIPTION **description
);
FMOD_RESULT FMOD_System_GetDSPInfoByType(
  FMOD_SYSTEM *system,
  FMOD_DSP_TYPE type,
  const FMOD_DSP_DESCRIPTION **description
);
RESULT System.getDSPInfoByType(
  DSP_TYPE type,
  out IntPtr description
);
System.getDSPInfoByType(
  type,
  description
);
type
Type of built in unit. (FMOD_DSP_TYPE)
description Out
Description structure for the DSP. (FMOD_DSP_DESCRIPTION)

FMOD_DSP_TYPE_MIXER not supported.

See Also: System::getDSPInfoByPlugin

System::getFileUsage

Retrieves information about file reads.

C
C++
C#
JS

FMOD_RESULT System::getFileUsage(
  long long *sampleBytesRead,
  long long *streamBytesRead,
  long long *otherBytesRead
);
FMOD_RESULT FMOD_System_GetFileUsage(
  FMOD_SYSTEM *system,
  long long *sampleBytesRead,
  long long *streamBytesRead,
  long long *otherBytesRead
);
RESULT System.getFileUsage(
  out Int64 sampleBytesRead,
  out Int64 streamBytesRead,
  out Int64 otherBytesRead
);
System.getFileUsage(
  sampleBytesRead,
  streamBytesRead,
  otherBytesRead
);
sampleBytesRead OptOut

Total bytes read from file for loading sample data.

  • Units: Bytes
streamBytesRead OptOut

Total bytes read from file for streaming sounds.

  • Units: Bytes
otherBytesRead OptOut

Total bytes read for non-audio data such as bank files created in FMOD Studio.

  • Units: Bytes

The values returned are running totals that never reset.

System::getGeometryOcclusion

Calculates geometry occlusion between a listener and a sound source.

C
C++
C#
JS

FMOD_RESULT System::getGeometryOcclusion(
  const FMOD_VECTOR *listener,
  const FMOD_VECTOR *source,
  float *direct,
  float *reverb
);
FMOD_RESULT FMOD_System_GetGeometryOcclusion(
  FMOD_SYSTEM *system,
  const FMOD_VECTOR *listener,
  const FMOD_VECTOR *source,
  float *direct,
  float *reverb
);
RESULT System.getGeometryOcclusion(
  ref VECTOR listener,
  ref VECTOR source,
  out float direct,
  out float reverb
);
System.getGeometryOcclusion(
  listener,
  source,
  direct,
  reverb
);
listener
The listener position. (FMOD_VECTOR)
source
The source position. (FMOD_VECTOR)
direct OptOut
Direct occlusion value. 0 = not occluded at all / full volume, 1 = fully occluded / silent.
reverb OptOut
Reverb occlusion value. 0 = not occluded at all / wet, 1 = fully occluded / dry.

If single sided polygons have been created, it is important to get the source and listener positions around the right way,
as the occlusion from point A to point B may not be the same as the occlusion from point B to point A.

See Also: System::createGeometry

System::getGeometrySettings

Retrieves the maximum world size for the geometry engine.

C
C++
C#
JS

FMOD_RESULT System::getGeometrySettings(
  float *maxworldsize
);
FMOD_RESULT FMOD_System_GetGeometrySettings(
  FMOD_SYSTEM *system,
  float *maxworldsize
);
RESULT System.getGeometrySettings(
  out float maxworldsize
);
System.getGeometrySettings(
  maxworldsize
);
maxworldsize Out
Maximum world size.

FMOD uses an efficient spatial partitioning system to store polygons for ray casting purposes.
The maximum size of the world should be set to allow processing within a known range.
Outside of this range, objects and polygons will not be processed as efficiently.
Excessive world size settings can also cause loss of precision and efficiency.

See Also: System::setGeometrySettings

System::getMasterChannelGroup

Retrieves the master ChannelGroup that all sounds ultimately route to.

C
C++
C#
JS

FMOD_RESULT System::getMasterChannelGroup(
  ChannelGroup **channelgroup
);
FMOD_RESULT FMOD_System_GetMasterChannelGroup(
  FMOD_SYSTEM *system,
  FMOD_CHANNELGROUP **channelgroup
);
RESULT System.getMasterChannelGroup(
  out ChannelGroup channelgroup
);
System.getMasterChannelGroup(
  channelgroup
);
channelgroup Out
Master group. (ChannelGroup)

This is the default ChannelGroup that Channels play on, unless a different ChannelGroup is specified with System::playSound, System::playDSP or Channel::setChannelGroup.
A master ChannelGroup can be used to do things like set the 'master volume' for all playing Channels. See ChannelControl::setVolume.

See Also: System::createChannelGroup

System::getMasterSoundGroup

Retrieves the default SoundGroup, where all sounds are placed when they are created.

C
C++
C#
JS

FMOD_RESULT System::getMasterSoundGroup(
  SoundGroup **soundgroup
);
FMOD_RESULT FMOD_System_GetMasterSoundGroup(
  FMOD_SYSTEM *system,
  FMOD_SOUNDGROUP **soundgroup
);
RESULT System.getMasterSoundGroup(
  out SoundGroup soundgroup
);
System.getMasterSoundGroup(
  soundgroup
);
soundgroup Out
Master sound group. (SoundGroup)

If SoundGroup is released, the Sounds will be put back into this SoundGroup.

See Also: SoundGroup::release, Sound::setSoundGroup

System::getNestedPlugin

Retrieves the handle of a nested plug-in.

C
C++
C#
JS

FMOD_RESULT System::getNestedPlugin(
  unsigned int handle,
  int index,
  unsigned int *nestedhandle
);
FMOD_RESULT FMOD_System_GetNestedPlugin(
  FMOD_SYSTEM *system,
  unsigned int handle,
  int index,
  unsigned int *nestedhandle
);
RESULT System.getNestedPlugin(
  uint handle,
  int index,
  out uint nestedhandle
);
System.getNestedPlugin(
  handle,
  index,
  nestedhandle
);
handle
Handle obtained from System::loadPlugin.
index

Index into the list of plug-in definitions.

nestedhandle Out
Handle used to represent the nested plug-in.

This function is used to iterate handles for plug-ins that have a list of definitions.

Most plug-ins contain a single definition. If this is the case, only index 0 is valid, and the returned handle is the same as the handle passed in.

See the DSP Plug-in API guide for more information.

System::getNetworkProxy

Retrieves the URL of the proxy server used in internet streaming.

C
C++
C#
JS

FMOD_RESULT System::getNetworkProxy(
  char *proxy,
  int proxylen
);
FMOD_RESULT FMOD_System_GetNetworkProxy(
  FMOD_SYSTEM *system,
  char *proxy,
  int proxylen
);
RESULT System.getNetworkProxy(
  out string proxy,
  int proxylen
);
System.getNetworkProxy(
  proxy
);
proxy Out
Proxy server URL. (UTF-8 string)
proxylen
Length of proxy.

See Also: System::setNetworkProxy

System::getNetworkTimeout

Retrieve the timeout value for network streams.

C
C++
C#
JS

FMOD_RESULT System::getNetworkTimeout(
  int *timeout
);
FMOD_RESULT FMOD_System_GetNetworkTimeout(
  FMOD_SYSTEM *system,
  int *timeout
);
RESULT System.getNetworkTimeout(
  out int timeout
);
System.getNetworkTimeout(
  timeout
);
timeout Out

Timeout value.

Units: Milliseconds

System::getNumDrivers

Retrieves the number of output drivers available for the selected output type.

C
C++
C#
JS

FMOD_RESULT System::getNumDrivers(
  int *numdrivers
);
FMOD_RESULT FMOD_System_GetNumDrivers(
  FMOD_SYSTEM *system,
  int *numdrivers
);
RESULT System.getNumDrivers(
  out int numdrivers
);
System.getNumDrivers(
  numdrivers
);
numdrivers Out
Number of output drivers.

If System::setOutput has not been called, this function will return the number of drivers available for the default output type.
A possible use for this function is to iterate through available sound devices for the current output type, and use System::getDriverInfo to get the device's name and other attributes.

See Also: System::getDriver

System::getNumNestedPlugins

Retrieves the number of nested plug-ins from the selected plug-in.

C
C++
C#
JS

FMOD_RESULT System::getNumNestedPlugins(
  unsigned int handle,
  int *count
);
FMOD_RESULT FMOD_System_GetNumNestedPlugins(
  FMOD_SYSTEM *system,
  unsigned int handle,
  int *count
);
RESULT System.getNumNestedPlugins(
  uint handle,
  out int count
);
System.getNumNestedPlugins(
  handle,
  count
);
handle
Handle obtained from System::loadPlugin.
count
Returned number of plug-ins.

Most plug-ins contain a single definition, in which case the count is 1, however some have a list of definitions. This function returns the number of plug-ins that have been defined.

See the DSP Plug-in API guide for more information.

See Also: System::getNestedPlugin

System::getNumPlugins

Retrieves the number of loaded plug-ins.

C
C++
C#
JS

FMOD_RESULT System::getNumPlugins(
  FMOD_PLUGINTYPE plugintype,
  int *numplugins
);
FMOD_RESULT FMOD_System_GetNumPlugins(
  FMOD_SYSTEM *system,
  FMOD_PLUGINTYPE plugintype,
  int *numplugins
);
RESULT System.getNumPlugins(
  PLUGINTYPE plugintype,
  out int numplugins
);
System.getNumPlugins(
  plugintype,
  numplugins
);
plugintype
Plugin type. (FMOD_PLUGINTYPE)
numplugins Out
Number of loaded plug-ins for the selected plugintype.

See Also: System::loadPlugin, System::getPluginHandle

System::getOutput

Retrieves the type of output interface used to run the mixer.

C
C++
C#
JS

FMOD_RESULT System::getOutput(
  FMOD_OUTPUTTYPE *output
);
FMOD_RESULT FMOD_System_GetOutput(
  FMOD_SYSTEM *system,
  FMOD_OUTPUTTYPE *output
);
RESULT System.getOutput(
  out OUTPUTTYPE output
);
System.getOutput(
  output
);
output Out
Output type. (FMOD_OUTPUTTYPE)

See Also: System::setOutput

System::getOutputByPlugin

Retrieves the plug-in handle for the currently selected output type.

C
C++
C#
JS

FMOD_RESULT System::getOutputByPlugin(
  unsigned int *handle
);
FMOD_RESULT FMOD_System_GetOutputByPlugin(
  FMOD_SYSTEM *system,
  unsigned int *handle
);
RESULT System.getOutputByPlugin(
  out uint handle
);
System.getOutputByPlugin(
  handle
);
handle Out
Handle to a pre-existing output plug-in.

See Also: System::getNumPlugins, System::setOutputByPlugin, System::setOutput

System::getOutputHandle

Retrieves an output type specific internal native interface.

C
C++
C#
JS

FMOD_RESULT System::getOutputHandle(
  void **handle
);
FMOD_RESULT FMOD_System_GetOutputHandle(
  FMOD_SYSTEM *system,
  void **handle
);
RESULT System.getOutputHandle(
  out IntPtr handle
);
System.getOutputHandle(
  handle
);
handle Out
Internal native handle.

Reinterpret the returned handle based on the selected output type, not all types return something.

See Also: FMOD_OUTPUTTYPE, System::setOutput, System::init

System::getPluginHandle

Retrieves the handle of a plug-in based on its type and relative index.

C
C++
C#
JS

FMOD_RESULT System::getPluginHandle(
  FMOD_PLUGINTYPE plugintype,
  int index,
  unsigned int *handle
);
FMOD_RESULT FMOD_System_GetPluginHandle(
  FMOD_SYSTEM *system,
  FMOD_PLUGINTYPE plugintype,
  int index,
  unsigned int *handle
);
RESULT System.getPluginHandle(
  PLUGINTYPE plugintype,
  int index,
  out uint handle
);
System.getPluginHandle(
  plugintype,
  index,
  handle
);
plugintype
Plug-in type. (FMOD_PLUGINTYPE)
index
Index in the list of plug-ins for the given plugintype.
handle Out
Handle used to represent the plugin.

All plug-ins, whether built-in or loaded, can be enumerated using this and System::getNumPlugins.

See Also: System::loadPlugin

System::getPluginInfo

Retrieves information for the selected plug-in.

C
C++
C#
JS

FMOD_RESULT System::getPluginInfo(
  unsigned int handle,
  FMOD_PLUGINTYPE *plugintype,
  char *name,
  int namelen,
  unsigned int *version
);
FMOD_RESULT FMOD_System_GetPluginInfo(
  FMOD_SYSTEM *system,
  unsigned int handle,
  FMOD_PLUGINTYPE *plugintype,
  char *name,
  int namelen,
  unsigned int *version
);
RESULT System.getPluginInfo(
  uint handle,
  out PLUGINTYPE plugintype,
  out string name,
  int namelen,
  out uint version
);
System.getPluginInfo(
  handle,
  plugintype,
  name,
  version
);
handle
Handle to an already loaded plug-in.
plugintype OptOut
Plug-in type. (FMOD_PLUGINTYPE)
name OptOut
Name of the plug-in. (UTF-8 string)
namelen

Length of name.

  • Units: Bytes
version OptOut
Version number of the plug-in.

See Also: System::getNumPlugins, System::getPluginHandle

System::getRecordDriverInfo

Retrieves identification information about an audio device specified by its index, and specific to the output mode.

C
C++
C#
JS

FMOD_RESULT System::getRecordDriverInfo(
  int id,
  char *name,
  int namelen,
  FMOD_GUID *guid,
  int *systemrate,
  FMOD_SPEAKERMODE *speakermode,
  int *speakermodechannels,
  FMOD_DRIVER_STATE *state
);
FMOD_RESULT FMOD_System_GetRecordDriverInfo(
  FMOD_SYSTEM *system,
  int id,
  char *name,
  int namelen,
  FMOD_GUID *guid,
  int *systemrate,
  FMOD_SPEAKERMODE *speakermode,
  int *speakermodechannels,
  FMOD_DRIVER_STATE *state
);
RESULT System.getRecordDriverInfo(
  int id,
  out string name,
  int namelen,
  out Guid guid,
  out int systemrate,
  out SPEAKERMODE speakermode,
  out int speakermodechannels,
  out DRIVER_STATE state
);
System.getRecordDriverInfo(
  id,
  name,
  guid,
  systemrate,
  speakermode,
  speakermodechannels,
  state
);
id

Index of the recording device.

name OptOut
The name of the device. (UTF-8 string)
namelen
The length of the target buffer receiving the name string.
guid OptOut
A GUID that uniquely identifies the device. (FMOD_GUID)
systemrate OptOut
The sample rate the device operates at.
speakermode OptOut
The speaker configuration the device is currently using. (FMOD_SPEAKERMODE)
speakermodechannels OptOut
The number of channels in the current speaker setup.
state OptOut
Flags that provide additional information about the driver. (FMOD_DRIVER_STATE)

See Also: System::setOutput

System::getRecordNumDrivers

Retrieves the number of recording devices available for this output mode. Use this to enumerate all recording devices possible so that the user can select one.

C
C++
C#
JS

FMOD_RESULT System::getRecordNumDrivers(
  int *numdrivers,
  int *numconnected
);
FMOD_RESULT FMOD_System_GetRecordNumDrivers(
  FMOD_SYSTEM *system,
  int *numdrivers,
  int *numconnected
);
RESULT System.getRecordNumDrivers(
  out int numdrivers,
  out int numconnected
);
System.getRecordNumDrivers(
  numdrivers,
  numconnected
);
numdrivers OptOut
Number of recording drivers available for this output mode.
numconnected OptOut
Number of recording driver currently plugged in.

See Also: System::getRecordDriverInfo

System::getRecordPosition

Retrieves the current recording position of the record buffer in PCM samples.

C
C++
C#
JS

FMOD_RESULT System::getRecordPosition(
  int id,
  unsigned int *position
);
FMOD_RESULT FMOD_System_GetRecordPosition(
  FMOD_SYSTEM *system,
  int id,
  unsigned int *position
);
RESULT System.getRecordPosition(
  int id,
  out uint position
);
System.getRecordPosition(
  id,
  position
);
id

Index of the recording device.

position Out

Current recording position.

Units: Samples

Will return FMOD_ERR_RECORD_DISCONNECTED if the driver is unplugged.

The position will return to 0 when System::recordStop is called or when a non-looping recording reaches the end.

PS4 specific note: Record devices are virtual so 'position' will continue to update if the device is unplugged (the OS is generating silence). This function will still report FMOD_ERR_RECORD_DISCONNECTED for your information though.

See Also: System::recordStart, System::recordStop

System::getReverbProperties

Retrieves the current reverb environment for the specified reverb instance.

C
C++
C#
JS

FMOD_RESULT System::getReverbProperties(
  int instance,
  FMOD_REVERB_PROPERTIES *prop
);
FMOD_RESULT FMOD_System_GetReverbProperties(
  FMOD_SYSTEM *system,
  int instance,
  FMOD_REVERB_PROPERTIES *prop
);
RESULT System.getReverbProperties(
  int instance,
  out REVERB_PROPERTIES prop
);
System.getReverbProperties(
  instance,
  prop
);
instance
Index of the particular reverb instance to target.
prop Out
Current reverb environment description. (FMOD_REVERB_PROPERTIES)

See Also: System::setReverbProperties

System::getSoftwareChannels

Retrieves the maximum number of software mixed Channels possible.

C
C++
C#
JS

FMOD_RESULT System::getSoftwareChannels(
  int *numsoftwarechannels
);
FMOD_RESULT FMOD_System_GetSoftwareChannels(
  FMOD_SYSTEM *system,
  int *numsoftwarechannels
);
RESULT System.getSoftwareChannels(
  out int numsoftwarechannels
);
System.getSoftwareChannels(
  numsoftwarechannels
);
numsoftwarechannels Out
Current maximum number of real voices (Channels) available.

Software Channels refers to real voices that will play, with numsoftwarechannels refering to the maximum number of voices before successive voices start becoming virtual. For differences between real and virtual voices see the Virtual Voices guide.

See Also: System::setSoftwareChannels

System::getSoftwareFormat

Retrieves the output format for the software mixer.

C
C++
C#
JS

FMOD_RESULT System::getSoftwareFormat(
  int *samplerate,
  FMOD_SPEAKERMODE *speakermode,
  int *numrawspeakers
);
FMOD_RESULT FMOD_System_GetSoftwareFormat(
  FMOD_SYSTEM *system,
  int *samplerate,
  FMOD_SPEAKERMODE *speakermode,
  int *numrawspeakers
);
RESULT System.getSoftwareFormat(
  out int samplerate,
  out SPEAKERMODE speakermode,
  out int numrawspeakers
);
System.getSoftwareFormat(
  samplerate,
  speakermode,
  numrawspeakers
);
samplerate OptOut
Sample rate of the mixer.
speakermode OptOut
Speaker setup of the mixer. (FMOD_SPEAKERMODE)
numrawspeakers OptOut
Number of speakers for FMOD_SPEAKERMODE_RAW mode.

See Also: System::setSoftwareFormat

System::getSpeakerModeChannels

Retrieves the channel count for a given speaker mode.

C
C++
C#
JS

FMOD_RESULT System::getSpeakerModeChannels(
  FMOD_SPEAKERMODE mode,
  int *channels
);
FMOD_RESULT FMOD_System_GetSpeakerModeChannels(
  FMOD_SYSTEM *system,
  FMOD_SPEAKERMODE mode,
  int *channels
);
RESULT System.getSpeakerModeChannels(
  SPEAKERMODE mode,
  out int channels
);
System.getSpeakerModeChannels(
  mode,
  channels
);
mode
Speaker mode to query. (FMOD_SPEAKERMODE)
channels Out
Number of channels.

System::getSpeakerPosition

Retrieves the position of the specified speaker for the current speaker mode.

C
C++
C#
JS

FMOD_RESULT System::getSpeakerPosition(
  FMOD_SPEAKER speaker,
  float *x,
  float *y,
  bool *active
);
FMOD_RESULT FMOD_System_GetSpeakerPosition(
  FMOD_SYSTEM *system,
  FMOD_SPEAKER speaker,
  float *x,
  float *y,
  FMOD_BOOL *active
);
RESULT System.getSpeakerPosition(
  SPEAKER speaker,
  out float x,
  out float y,
  out bool active
);
System.getSpeakerPosition(
  speaker,
  x,
  y,
  active
);
speaker
Speaker. (FMOD_SPEAKER)
x OptOut

2D X position relative to the listener. -1 = left, 0 = middle, +1 = right.

  • Range: [-1, 1]
y OptOut

2D Y position relative to the listener. -1 = back, 0 = middle, +1 = front.

  • Range: [-1, 1]
active OptOut

Active state of a speaker. True = included in 3D calculations, False = ignored.

  • Units: Boolean

See Also: System::setSpeakerPosition

System::getStreamBufferSize

Retrieves the default file buffer size for newly opened streams.

C
C++
C#
JS

FMOD_RESULT System::getStreamBufferSize(
  unsigned int *filebuffersize,
  FMOD_TIMEUNIT *filebuffersizetype
);
FMOD_RESULT FMOD_System_GetStreamBufferSize(
  FMOD_SYSTEM *system,
  unsigned int *filebuffersize,
  FMOD_TIMEUNIT *filebuffersizetype
);
RESULT System.getStreamBufferSize(
  out uint filebuffersize,
  out TIMEUNIT filebuffersizetype
);
System.getStreamBufferSize(
  filebuffersize,
  filebuffersizetype
);
filebuffersize OptOut

Buffer size.

  • Default: 16384
filebuffersizetype OptOut

Type of units for filebuffersize. (FMOD_TIMEUNIT)

Valid units for filebuffersizetype are:

See Also: System::setStreamBufferSize

System::getUserData

Retrieves a user value associated with a System object.

C
C++
C#
JS

FMOD_RESULT System::getUserData(
  void **userdata
);
FMOD_RESULT FMOD_System_GetUserData(
  FMOD_SYSTEM *system,
  void **userdata
);
RESULT System.getUserData(
  out IntPtr userdata
);
System.getUserData(
  userdata
);
userdata Out
User data set by calling System::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.

System::getVersion

Retrieves the FMOD version and build number.

C
C++
C#
JS

FMOD_RESULT System::getVersion(
  unsigned int *version,
  unsigned int *buildnumber = 0
);
FMOD_RESULT FMOD_System_GetVersion(
  FMOD_SYSTEM *system,
  unsigned int *version,
  unsigned int *buildnumber
);
RESULT System.getVersion(
  out uint version
);
RESULT System.getVersion(
  out uint version,
  out uint buildnumber
);
System.getVersion(
  version,
  buildnumber
);
version OutOpt
Version number.
buildnumber OutOpt
Build number.

The version is a 32 bit hexadecimal value formatted as 16:8:8, with the upper 16 bits being the product version, the middle 8 bits being the major version and the bottom 8 bits being the minor version. For example a value of 0x00010203 is equal to 1.02.03.

Compare against FMOD_VERSION to make sure header and runtime library versions match.

See Also: System_Create

System::init

Initialize the system object and prepare FMOD for playback.

C
C++
C#
JS

FMOD_RESULT System::init(
  int maxchannels,
  FMOD_INITFLAGS flags,
  void *extradriverdata
);
FMOD_RESULT FMOD_System_Init(
  FMOD_SYSTEM *system,
  int maxchannels,
  FMOD_INITFLAGS flags,
  void *extradriverdata
);
RESULT System.init(
  int maxchannels,
  INITFLAGS flags,
  IntPtr extradriverdata
);
System.init(
  maxchannels,
  flags,
  extradriverdata
);
maxchannels

Maximum number of Channel objects available for playback, also known as virtual voices. Virtual voices will play with minimal overhead, with a subset of 'real' voices that are mixed, and selected based on priority and audibility. See the Virtual Voices guide for more information.

  • Range: [0, 4095]
flags
Initialization flags. More than one mode can be set at once by combining them with the OR operator. (FMOD_INITFLAGS)
extradriverdata Opt
Additional output specific initialization data. This will be passed to the output plug-in. See FMOD_OUTPUTTYPE for descriptions of data that can be passed in, based on the selected output mode.

A system object must be created with System_create

Most API functions require an initialized System object before they will succeed, otherwise they will return FMOD_ERR_UNINITIALIZED. Some can only be called before initialization. These are:

System::setOutput / System::setOutputByPlugin can be called before or after System::init on Android, GameCore, UWP, Windows and Mac. Other platforms can only call this before System::init.

See Also: System::close, System::release

System::isRecording

Retrieves the state of the FMOD recording API, ie if it is currently recording or not.

C
C++
C#
JS

FMOD_RESULT System::isRecording(
  int id,
  bool *recording
);
FMOD_RESULT FMOD_System_IsRecording(
  FMOD_SYSTEM *system,
  int id,
  FMOD_BOOL *recording
);
RESULT System.isRecording(
  int id,
  out bool recording
);
System.isRecording(
  id,
  recording
);
id

Index of the recording device.

recording OptOut

Recording state. True = system is recording, False = system is not recording.

  • Units: Boolean

Recording can be started with System::recordStart and stopped with System::recordStop.

Will return FMOD_ERR_RECORD_DISCONNECTED if the driver is unplugged.

PS4 specific note: Record devices are virtual so 'recording' will continue to report true if the device is unplugged (the OS is generating silence). This function will still report FMOD_ERR_RECORD_DISCONNECTED for your information though.

See Also: System::getRecordPosition

System::loadGeometry

Creates a geometry object from a block of memory which contains pre-saved geometry data.

This function avoids the need to manually create and add geometry for faster start time.

C
C++
C#
JS

FMOD_RESULT System::loadGeometry(
  const void *data,
  int datasize,
  Geometry **geometry
);
FMOD_RESULT FMOD_System_LoadGeometry(
  FMOD_SYSTEM *system,
  const void *data,
  int datasize,
  FMOD_GEOMETRY **geometry
);
RESULT System.loadGeometry(
  IntPtr data,
  int datasize,
  out Geometry geometry
);
System.loadGeometry(
  data,
  datasize,
  geometry
);
data
Pre-saved geometry data from Geometry::save.
datasize
Size of data.
geometry Out
Newly created geometry object. (Geometry)

See Also: System::createGeometry

System::loadPlugin

Loads an FMOD plug-in (DSP, output or codec) from a file.

C
C++
C#
JS

FMOD_RESULT System::loadPlugin(
  const char *filename,
  unsigned int *handle,
  unsigned int priority = 0
);
FMOD_RESULT FMOD_System_LoadPlugin(
  FMOD_SYSTEM *system,
  const char *filename,
  unsigned int *handle,
  unsigned int priority
);
RESULT System.loadPlugin(
  string filename,
  out uint handle,
  uint priority = 0
);

Currently not supported for JavaScript.

filename
Path to the plug-in file. (UTF-8 string)
handle Out
Handle used to represent the plug-in.
priority Opt
Codec load priority where 0 represents most important and higher numbers represent less importance. FMOD_PLUGINTYPE_CODEC only.

Once loaded, DSP plug-ins can be used via System::createDSPByPlugin, output plug-ins can be used via System::setOutputByPlugin, and codec plug-ins are used automatically.

When opening a file each codec tests whether it can support the file format in priority order.

The format of the plug-in is dependent on the operating system:

See Also: System::unloadPlugin, System::setPluginPath, System::getNumPlugins, System::getPluginHandle, System::getPluginInfo

System::lockDSP

Mutual exclusion function to lock the DSP engine (which runs asynchronously in another thread), so that it will not execute.

C
C++
C#
JS

FMOD_RESULT System::lockDSP();
FMOD_RESULT FMOD_System_LockDSP(FMOD_SYSTEM *system);
RESULT System.lockDSP();
System.lockDSP();

If the DSP engine is already executing, this function is blocked until it has completed.

The function may be used to synchronize DSP graph operations carried out by your code. For example, you could use this to construct a DSP sub-graph without the DSP engine executing in the background while the sub-graph is still under construction.

Once you no longer need the DSP engine to be locked, it can be unlocked with System::unlockDSP.

Note that if the DSP engine is locked for a significant amount of time, it may result in audible skipping or stuttering.

System::mixerResume

Resume mixer thread and reacquire access to audio hardware.

C
C++
C#
JS

FMOD_RESULT System::mixerResume();
FMOD_RESULT FMOD_System_MixerResume(FMOD_SYSTEM *system);
RESULT System.mixerResume();
System.mixerResume();

Used on mobile platforms when entering the foreground after being suspended.

All internal state will resume, i.e. created Sound and Channels are still valid and playback will continue.

Android specific: Must be called on the same thread as System::mixerSuspend.

HTML5 specific: Used to start audio from a user interaction event, like a mouse click or screen touch event. Without this call audio may not start on some browsers.

See Also: System::mixerSuspend

System::mixerSuspend

Suspend mixer thread and relinquish usage of audio hardware while maintaining internal state.

C
C++
C#
JS

FMOD_RESULT System::mixerSuspend();
FMOD_RESULT FMOD_System_MixerSuspend(FMOD_SYSTEM *system);
RESULT System.mixerSuspend();
System.mixerSuspend();

Used on mobile platforms when entering a backgrounded state to reduce CPU to 0%.

All internal state will be maintained, i.e. created Sound and Channels will stay available in memory.

See Also: System::mixerResume

System::playDSP

Plays a DSP along with any of its inputs on a Channel.

C
C++
C#
JS

FMOD_RESULT System::playDSP(
  DSP *dsp,
  ChannelGroup *channelgroup,
  bool paused,
  Channel **channel
);
FMOD_RESULT FMOD_System_PlayDSP(
  FMOD_SYSTEM *system,
  FMOD_DSP *dsp,
  FMOD_CHANNELGROUP *channelgroup,
  FMOD_BOOL paused,
  FMOD_CHANNEL **channel
);
RESULT System.playDSP(
  DSP dsp,
  ChannelGroup channelgroup,
  bool paused,
  out Channel channel
);
System.playDSP(
  dsp,
  channelgroup,
  paused,
  channel
);
dsp
Unit to play. (DSP)
channelgroup Opt
Group to output to instead of the master. (ChannelGroup)
paused

Whether to start in the paused state. Start a Channel paused to allow altering attributes without it being audible, then follow it up with a call to ChannelControl::setPaused with paused = False.

  • Units: Boolean
channel OptOut
Newly playing Channel. (Channel)

Specifying a channelgroup as part of playDSP is more efficient than using Channel::setChannelGroup after playDSP, and could avoid audible glitches if the playDSP is not in a paused state.

Channels are reference counted to handle dead or stolen Channel handles. See the white paper on Channel handles for more information.

Playing more Sounds or DSPs than physical Channels allow is handled with virtual voices. See the white paper on Virtual Voices for more information.

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

System::playSound

Plays a Sound on a Channel.

C
C++
C#
JS

FMOD_RESULT System::playSound(
  Sound *sound,
  ChannelGroup *channelgroup,
  bool paused,
  Channel **channel
);
FMOD_RESULT FMOD_System_PlaySound(
  FMOD_SYSTEM *system,
  FMOD_SOUND *sound,
  FMOD_CHANNELGROUP *channelgroup,
  FMOD_BOOL paused,
  FMOD_CHANNEL **channel
);
RESULT System.playSound(
  Sound sound,
  ChannelGroup channelgroup,
  bool paused,
  out Channel channel
);
System.playSound(
  sound,
  channelgroup,
  paused,
  channel
);
sound
Sound to play. (Sound)
channelgroup Opt
Group to output to instead of the master. (ChannelGroup)
paused

Whether to start in the paused state. Start a Channel paused to allow altering attributes without it being audible, then follow it up with a call to ChannelControl::setPaused with paused = False.

  • Units: Boolean
channel OptOut
Newly playing Channel. (Channel)

When a sound is played, it will use the sound's default frequency and priority. See Sound::setDefaults.

A sound defined as FMOD_3D will by default play at the 3D position of the listener. To set the 3D position of the Channel before the sound is audible, start the Channel paused by setting the paused parameter to true, and call ChannelControl::set3DAttributes.

Specifying a channelgroup as part of playSound is more efficient than using Channel::setChannelGroup after playSound, and could avoid audible glitches if the playSound is not in a paused state.

Channels are reference counted to handle dead or stolen Channel handles. See the white paper on Channel handles for more information.

Playing more Sounds than physical Channels allow is handled with virtual voices. See the white paper on Virtual Voices for more information.

See Also: System::createSound, System::createStream

System::recordStart

Starts the recording engine recording to a pre-created Sound object.

C
C++
C#
JS

FMOD_RESULT System::recordStart(
  int id,
  Sound *sound,
  bool loop
);
FMOD_RESULT FMOD_System_RecordStart(
  FMOD_SYSTEM *system,
  int id,
  FMOD_SOUND *sound,
  FMOD_BOOL loop
);
RESULT System.recordStart(
  int id,
  Sound sound,
  bool loop
);
System.recordStart(
  id,
  sound,
  loop
);
id

Index of the recording device.

sound
User created sound for the user to record to. (Sound)
loop

Flag to tell the recording engine whether to continue recording to the provided sound from the start again, after it has reached the end. If this is set to true the data will be continually be overwritten once every loop.

  • Units: Boolean

Will return FMOD_ERR_RECORD_DISCONNECTED if the driver is unplugged.

Sound must be created as FMOD_CREATESAMPLE. Raw PCM data can be accessed with Sound::lock, Sound::unlock and System::getRecordPosition.

Recording from the same driver a second time will stop the first recording.

For lowest latency set the FMOD::Sound sample rate to the rate returned by System::getRecordDriverInfo, otherwise a resampler will be allocated to handle the difference in frequencies, which adds latency.

See Also: System::recordStop

System::recordStop

Stops the recording engine from recording to a pre-created Sound object.

C
C++
C#
JS

FMOD_RESULT System::recordStop(
  int id
);
FMOD_RESULT FMOD_System_RecordStop(
  FMOD_SYSTEM *system,
  int id
);
RESULT System.recordStop(
  int id
);
System.recordStop(
  id
);
id

Index of the recording device.

Returns no error if unplugged or already stopped.

See Also: System::recordStart

System::registerCodec

Register a Codec plug-in description structure for later use.

C
C++
C#
JS

FMOD_RESULT System::registerCodec(
  FMOD_CODEC_DESCRIPTION *description,
  unsigned int *handle,
  unsigned int priority = 0
);
FMOD_RESULT FMOD_System_RegisterCodec(
  FMOD_SYSTEM *system,
  FMOD_CODEC_DESCRIPTION *description,
  unsigned int *handle,
  unsigned int priority
);
System.registerCodec(
  description,
  handle,
  priority
);

Currently not supported for C#.

description
Structure describing the Codec to register. (FMOD_CODEC_DESCRIPTION)
handle Out
Handle used to represent the plug-in.
priority Opt
Codec load priority where 0 represents most important and higher numbers represent less importance.

To create an instances of this plug-in use System::createSound and System::createStream.

When opening a file each Codec tests whether it can support the file format in priority order. The priority for each FMOD_SOUND_TYPE are as follows:

FMOD_SOUND_TYPE Priority
FMOD_SOUND_TYPE_FSB 250
FMOD_SOUND_TYPE_XMA 250
FMOD_SOUND_TYPE_AT9 250
FMOD_SOUND_TYPE_VORBIS 250
FMOD_SOUND_TYPE_OPUS 250
FMOD_SOUND_TYPE_FADPCM 250
FMOD_SOUND_TYPE_WAV 600
FMOD_SOUND_TYPE_OGGVORBIS 800
FMOD_SOUND_TYPE_AIFF 1000
FMOD_SOUND_TYPE_FLAC 1100
FMOD_SOUND_TYPE_MOD 1200
FMOD_SOUND_TYPE_S3M 1300
FMOD_SOUND_TYPE_XM 1400
FMOD_SOUND_TYPE_IT 1500
FMOD_SOUND_TYPE_MIDI 1600
FMOD_SOUND_TYPE_DLS 1700
FMOD_SOUND_TYPE_ASF 1900
FMOD_SOUND_TYPE_AUDIOQUEUE 2200
FMOD_SOUND_TYPE_MEDIACODEC 2250
FMOD_SOUND_TYPE_MPEG 2400
FMOD_SOUND_TYPE_PLAYLIST 2450
FMOD_SOUND_TYPE_RAW 2500
FMOD_SOUND_TYPE_USER 2600
FMOD_SOUND_TYPE_MEDIA_FOUNDATION 2600

XMA, AT9, Vorbis, Opus and FADPCM are supported through the FSB format, and therefore have the same priority as FSB.

Media Foundation is supported through the User codec, and therefore has the same priority as User.

Raw and User are only accesible if FMOD_OPENRAW or FMOD_OPENUSER is specified as the mode in System::createSound.

System::registerDSP

Register a DSP plug-in description structure for later use.

C
C++
C#
JS

FMOD_RESULT System::registerDSP(
  const FMOD_DSP_DESCRIPTION *description,
  unsigned int *handle
);
FMOD_RESULT FMOD_System_RegisterDSP(
  FMOD_SYSTEM *system,
  const FMOD_DSP_DESCRIPTION *description,
  unsigned int *handle
);
RESULT System.registerDSP(
  ref DSP_DESCRIPTION description,
  out uint handle
);
System.registerDSP(
  description,
  handle
);
description
Structure describing the DSP to register. (FMOD_DSP_DESCRIPTION)
handle Out
Handle used to represent the plug-in.

To create an instance of this plug-in, use System::createDSPByPlugin.

System::registerOutput

Register an Output plug-in description structure for later use.

C
C++
C#
JS

FMOD_RESULT System::registerOutput(
  const FMOD_OUTPUT_DESCRIPTION *description,
  unsigned int *handle
);
FMOD_RESULT FMOD_System_RegisterOutput(
  FMOD_SYSTEM *system,
  const FMOD_OUTPUT_DESCRIPTION *description,
  unsigned int *handle
);
System.registerOutput(
  description,
  handle
);

Not supported for C#.

description
Structure describing the Output to register. (FMOD_OUTPUT_DESCRIPTION)
handle Out
Handle used to represent the plug-in.

To select this plug-in for output use, use System::setOutputByPlugin.

System::release

Closes and frees this object and its resources.

C
C++
C#
JS

FMOD_RESULT System::release();
FMOD_RESULT FMOD_System_Release(FMOD_SYSTEM *system);
RESULT System.release();
System.release();

This will internally call System::close, so calling System::close before this function is not necessary.

Calls to System_Create and System::release are not thread-safe. Do not call these functions simultaneously from multiple threads at once.

See Also: System::init

System::set3DListenerAttributes

Sets the position, velocity and orientation of the specified 3D sound listener.

C
C++
C#
JS

FMOD_RESULT System::set3DListenerAttributes(
  int listener,
  const FMOD_VECTOR *pos,
  const FMOD_VECTOR *vel,
  const FMOD_VECTOR *forward,
  const FMOD_VECTOR *up
);
FMOD_RESULT FMOD_System_Set3DListenerAttributes(
  FMOD_SYSTEM *system,
  int listener,
  const FMOD_VECTOR *pos,
  const FMOD_VECTOR *vel,
  const FMOD_VECTOR *forward,
  const FMOD_VECTOR *up
);
RESULT System.set3DListenerAttributes(
  int listener,
  ref VECTOR pos,
  ref VECTOR vel,
  ref VECTOR forward,
  ref VECTOR up
);
System.set3DListenerAttributes(
  listener,
  pos,
  vel,
  forward,
  up
);
listener

Index of listener to set 3D attributes on. Listeners are indexed from 0, to FMOD_MAX_LISTENERS - 1, in a multi-listener environment.

pos Opt

Position in 3D world space used for panning and attenuation. (FMOD_VECTOR)

vel Opt

Velocity in 3D space used for doppler. (FMOD_VECTOR)

forward Opt
Forwards orientation. (FMOD_VECTOR)
up Opt
Upwards orientation. (FMOD_VECTOR)

The forward and up vectors must be perpendicular and be of unit length (magnitude of each vector should be 1).

Vectors must be provided in the correct handedness.

For velocity, remember to use units per second, and not units per frame. This is a common mistake and will make the doppler effect sound wrong if velocity is based on movement per frame rather than a fixed time period.
If velocity per frame is calculated, it can be converted to velocity per second by dividing it by the time taken between frames as a fraction of a second.
i.e.

velocity_units_per_second = (position_currentframe - position_lastframe) / time_taken_since_last_frame_in_seconds.

At 60fps the formula would look like velocity_units_per_second = (position_currentframe - position_lastframe) / 0.0166667.

Users of the Studio API should call Studio::System::setListenerAttributes instead of this function.

See Also: System::get3DListenerAttributes, System::set3DSettings, System::get3DSettings

System::set3DNumListeners

Sets the number of 3D 'listeners' in the 3D sound scene.

C
C++
C#
JS

FMOD_RESULT System::set3DNumListeners(
  int numlisteners
);
FMOD_RESULT FMOD_System_Set3DNumListeners(
  FMOD_SYSTEM *system,
  int numlisteners
);
RESULT System.set3DNumListeners(
  int numlisteners
);
System.set3DNumListeners(
  numlisteners
);
numlisteners Out

Number of listeners in the scene.

This function is useful mainly for split-screen game purposes.

If the number of listeners is set to more than 1, then panning and doppler are turned off. All sound effects will be mono. FMOD uses a 'closest sound to the listener' method to determine what should be heard in this case.

Users of the Studio API should call Studio::System::setNumListeners instead of this function.

See Also: System::get3DNumListeners, System::set3DListenerAttributes

System::set3DRolloffCallback

Sets a callback to allow custom calculation of distance attenuation.

C
C++
C#
JS

FMOD_RESULT System::set3DRolloffCallback(
  FMOD_3D_ROLLOFF_CALLBACK callback
);
FMOD_RESULT FMOD_System_Set3DRolloffCallback(
  FMOD_SYSTEM *system,
  FMOD_3D_ROLLOFF_CALLBACK callback
);
RESULT System.set3DRolloffCallback(
  CB_3D_ROLLOFFCALLBACK callback
);

Not supported for JavaScript.

callback
Custom callback. Set to 0 or null to return control of distance attenuation to FMOD. (FMOD_3D_ROLLOFF_CALLBACK)

This function overrides FMOD_3D_INVERSEROLLOFF, FMOD_3D_LINEARROLLOFF, FMOD_3D_LINEARSQUAREROLLOFF, FMOD_3D_INVERSETAPEREDROLLOFF and FMOD_3D_CUSTOMROLLOFF.

See Also: Callback Behavior

System::set3DSettings

Sets the global doppler scale, distance factor and log roll-off scale for all 3D sound in FMOD.

C
C++
C#
JS

FMOD_RESULT System::set3DSettings(
  float dopplerscale,
  float distancefactor,
  float rolloffscale
);
FMOD_RESULT FMOD_System_Set3DSettings(
  FMOD_SYSTEM *system,
  float dopplerscale,
  float distancefactor,
  float rolloffscale
);
RESULT System.set3DSettings(
  float dopplerscale,
  float distancefactor,
  float rolloffscale
);
System.set3DSettings(
  dopplerscale,
  distancefactor,
  rolloffscale
);
dopplerscale

A scaling factor for doppler shift.

  • Default: 1
distancefactor

A factor for converting game distance units to FMOD distance units.

  • Default: 1
rolloffscale

A scaling factor for distance attenuation. When a sound uses a roll-off mode other than FMOD_3D_CUSTOMROLLOFF and the distance is greater than the sound's minimum distance, the distance is scaled by the roll-off scale.

  • Default: 1

The dopplerscale is a general scaling factor for how much the pitch varies due to doppler shifting in 3D sound. Doppler is the pitch bending effect when a sound comes towards the listener or moves away from it, much like the effect you hear when a train goes past you with its horn sounding. With "dopplerscale" you can exaggerate or diminish the effect. FMOD's effective speed of sound at a doppler factor of 1.0 is 340 m/s.

The distancefactor is the FMOD 3D engine relative distance factor, compared to 1.0 meters. Another way to put it is that it equates to "how many units per meter does your engine have". For example, if you are using feet then "scale" would equal 3.28.
This only affects doppler. If you keep your min/max distance, custom roll-off curves, and positions in scale relative to each other, the volume roll-off will not change. If you set this, the mindistance of a sound will automatically set itself to this value when it is created in case the user forgets to set the mindistance to match the new distancefactor.

The rolloffscale is a global factor applied to the roll-off of sounds using roll-off modes other than FMOD_3D_CUSTOMROLLOFF. When a sound uses a roll-off mode other than FMOD_3D_CUSTOMROLLOFF and the distance is greater than the sound's minimum distance, the distance for the purposes of distance attenuation is calculated according to the formula distance = (distance - minDistance) * rolloffscale + minDistance.

See Also: System::get3DSettings, Sound::set3DMinMaxDistance, Sound::get3DMinMaxDistance, ChannelControl::set3DAttributes

System::setAdvancedSettings

Sets advanced settings for the system object, typically to allow adjusting of settings related to resource usage or audio quality.

C
C++
C#
JS

FMOD_RESULT System::setAdvancedSettings(
  FMOD_ADVANCEDSETTINGS *settings
);
FMOD_RESULT FMOD_System_SetAdvancedSettings(
  FMOD_SYSTEM *system,
  FMOD_ADVANCEDSETTINGS *settings
);
RESULT System.setAdvancedSettings(
  ref ADVANCEDSETTINGS settings
);
System.setAdvancedSettings(
  settings
);
settings
Advanced settings (FMOD_ADVANCEDSETTINGS)

To use, clear the FMOD_ADVANCEDSETTINGS structure to zeroes first, then set the cbSize member to the size in bytes of the FMOD_ADVANCEDSETTINGS structure. From here settings can be set one at a time, as all defaults are null or 0 for all members.

See Also: System::getAdvancedSettings

System::setCallback

Sets the callback for System level notifications.

C
C++
C#
JS

FMOD_RESULT System::setCallback(
  FMOD_SYSTEM_CALLBACK callback,
  FMOD_SYSTEM_CALLBACK_TYPE callbackmask = FMOD_SYSTEM_CALLBACK_ALL
);
FMOD_RESULT FMOD_System_SetCallback(
  FMOD_SYSTEM *system,
  FMOD_SYSTEM_CALLBACK callback,
  FMOD_SYSTEM_CALLBACK_TYPE callbackmask
);
RESULT System.setCallback(
  SYSTEM_CALLBACK callback,
  SYSTEM_CALLBACK_TYPE callbackmask = SYSTEM_CALLBACK_TYPE.ALL
);
System.setCallback(
  callback,
  callbackmask
);
callback
Callback to invoke when system notification happens. (FMOD_SYSTEM_CALLBACK)
callbackmask
Bitfield specifying which callback types are required, to filter out unwanted callbacks. (FMOD_SYSTEM_CALLBACK_TYPE)

System callbacks can be called by a variety of FMOD threads, so make sure any code executed inside the callback is thread safe.

See Also: Callback Behavior

System::setDriver

Sets the output driver for the selected output type.

C
C++
C#
JS

FMOD_RESULT System::setDriver(
  int driver
);
FMOD_RESULT FMOD_System_SetDriver(
  FMOD_SYSTEM *system,
  int driver
);
RESULT System.setDriver(
  int driver
);
System.setDriver(
  driver
);
driver

Driver index where 0 represents the default for the output type.

When an output type has more than one driver available, this function can be used to select between them.

If this function is called after System::init, the current driver will be shutdown and the newly selected driver will be initialized / started.

See Also: System::getDriver, System::getDriverInfo, System::setOutput

System::setDSPBufferSize

Sets the buffer size for the FMOD software mixing engine.

This function is used if you need to control mixer latency or granularity. Smaller buffersizes lead to smaller latency, but can lead to stuttering/skipping/unstable sound on slower machines or soundcards with bad drivers.

C
C++
C#
JS

FMOD_RESULT System::setDSPBufferSize(
  unsigned int bufferlength,
  int numbuffers
);
FMOD_RESULT FMOD_System_SetDSPBufferSize(
  FMOD_SYSTEM *system,
  unsigned int bufferlength,
  int numbuffers
);
RESULT System.setDSPBufferSize(
  uint bufferlength,
  int numbuffers
);
System.setDSPBufferSize(
  bufferlength,
  numbuffers
);
bufferlength

The mixer engine block size. Use this to adjust mixer update granularity. See below for more information on buffer length vs latency.

  • Units: Samples
  • Default: 1024
numbuffers

The mixer engine number of buffers used. Use this to adjust mixer latency. See below for more information on number of buffers vs latency.

  • Default: 4

To get the bufferlength in milliseconds, divide it by the output rate and multiply the result by 1000. For a bufferlength of 1024 and an output rate of 48khz (see System::SetSoftwareFormat), milliseconds = 1024 / 48000 * 1000 = 21.33ms. This means the mixer updates every 21.33ms.

To get the total buffer size multiply the bufferlength by the numbuffers value. By default this would be 4 * 1024 = 4096 samples, or 4 * 21.33ms = 85.33ms. This would generally be the total latency of the software mixer, but in reality due to one of the buffers being written to constantly, and the cursor position of the buffer that is audible, the latency is typically more like the (number of buffers - 1.5) multiplied by the buffer length.

To convert from milliseconds back to 'samples', simply multiply the value in milliseconds by the sample rate of the output (ie 48000 if that is what it is set to), then divide by 1000.

The FMOD software mixer mixes to a ringbuffer. The size of this ringbuffer is determined here. It mixes a block of sound data every 'bufferlength' number of samples, and there are 'numbuffers' number of these blocks that make up the entire ringbuffer. Adjusting these values can lead to extremely low latency performance (smaller values), or greater stability in sound output (larger values).

Warning! The 'buffersize' is generally best left alone. Making the granularity smaller will just increase CPU usage (cache misses and DSP graph overhead). Making it larger affects how often you hear commands update such as volume/pitch/pan changes. Anything above 20ms will be noticeable and sound parameter changes will be obvious instead of smooth.

FMOD chooses the most optimal size by default for best stability, depending on the output type. It is not recommended changing this value unless you really need to. You may get worse performance than the default settings chosen by FMOD. If you do set the size manually, the bufferlength argument must be a multiple of four, typically 256, 480, 512, 1024 or 2048 depedning on your latency requirements.

The values in milliseconds and average latency expected from the settings can be calculated using the following code:

FMOD_RESULT result;
unsigned int blocksize;
int numblocks;
float ms;

result = system->getDSPBufferSize(&blocksize, &numblocks);
result = system->getSoftwareFormat(&frequency, 0, 0);

ms = (float)blocksize * 1000.0f / (float)frequency;

printf("Mixer blocksize        = %.02f ms\n", ms);
printf("Mixer Total buffersize = %.02f ms\n", ms * numblocks);
printf("Mixer Average Latency  = %.02f ms\n", ms * ((float)numblocks - 1.5f));

See Also: System::getDSPBufferSize, System::getSoftwareFormat, System::init, System::close

System::setFileSystem

Set callbacks to implement all file I/O instead of using the platform native method.

C
C++
C#
JS

FMOD_RESULT System::setFileSystem(
  FMOD_FILE_OPEN_CALLBACK useropen,
  FMOD_FILE_CLOSE_CALLBACK userclose,
  FMOD_FILE_READ_CALLBACK userread,
  FMOD_FILE_SEEK_CALLBACK userseek,
  FMOD_FILE_ASYNCREAD_CALLBACK userasyncread,
  FMOD_FILE_ASYNCCANCEL_CALLBACK userasynccancel,
  int blockalign
);
FMOD_RESULT FMOD_System_SetFileSystem(
  FMOD_SYSTEM *system,
  FMOD_FILE_OPEN_CALLBACK useropen,
  FMOD_FILE_CLOSE_CALLBACK userclose,
  FMOD_FILE_READ_CALLBACK userread,
  FMOD_FILE_SEEK_CALLBACK userseek,
  FMOD_FILE_ASYNCREAD_CALLBACK userasyncread,
  FMOD_FILE_ASYNCCANCEL_CALLBACK userasynccancel,
  int blockalign
);
RESULT System.setFileSystem(
  FILE_OPENCALLBACK useropen,
  FILE_CLOSECALLBACK userclose,
  FILE_READCALLBACK userread,
  FILE_SEEKCALLBACK userseek,
  FILE_ASYNCREADCALLBACK userasyncread,
  FILE_ASYNCCANCELCALLBACK userasynccancel,
  int blockalign
);
System.setFileSystem(
  useropen,
  userclose,
  userread,
  userseek,
  userasyncread,
  userasynccancel,
  blockalign
);
useropen Opt
Callback for opening a file. (FMOD_FILE_OPEN_CALLBACK)
userclose Opt
Callback for closing a file. (FMOD_FILE_CLOSE_CALLBACK)
userread Opt
Callback for reading from a file, instead of userasyncread and userasynccancel. (FMOD_FILE_READ_CALLBACK)
userseek Opt
Callback for seeking within a file, instead of userasyncread and userasynccancel. (FMOD_FILE_SEEK_CALLBACK)
userasyncread Opt
Callback for reading and seeking asynchronously, instead of userread and userseek. (FMOD_FILE_ASYNCREAD_CALLBACK)
userasynccancel Opt
Callback for cancelling a previous userasyncread call. (FMOD_FILE_ASYNCCANCEL_CALLBACK)
blockalign Opt

File buffering chunk size, specify -1 to keep system default or previously set value. 0 = disable buffering, see notes below for more on this.

  • Default: 2048
  • Units: Bytes

Setting these callbacks have no effect on sounds loaded with FMOD_OPENMEMORY or FMOD_OPENUSER.

There are three valid configurations for this function:

  1. Set useropen, userclose, userread, userseek and optionally blockalign for blocking file I/O.
  2. Set useropen, userclose, userasyncread, userasynccancel and optionally blockalign for asynchronous file I/O.
  3. Set blockalign by itself with everything else null, to change platform native file I/O buffering.

Setting blockalign to 0 will disable file buffering and cause every read to invoke the relevant callback (not recommended), current default is tuned for memory usage vs performance. Be mindful of the I/O capabilities of the platform before increasing this default.

Asynchronous file access via userasyncread / userasynccanel.

Implementation tips to avoid hangs / crashes.

userasyncread and userasynccancel are not supported for JavaScript.

See Also: Callback Behavior, System::attachFileSystem

System::setGeometrySettings

Sets the maximum world size for the geometry engine for performance / precision reasons.

C
C++
C#
JS

FMOD_RESULT System::setGeometrySettings(
  float maxworldsize
);
FMOD_RESULT FMOD_System_SetGeometrySettings(
  FMOD_SYSTEM *system,
  float maxworldsize
);
RESULT System.setGeometrySettings(
  float maxworldsize
);
System.setGeometrySettings(
  maxworldsize
);
maxworldsize
Maximum size of the world from the centerpoint to the edge using the same units used in other 3D functions.

FMOD uses an efficient spatial partitioning system to store polygons for ray casting purposes.
The maximum size of the world should (maxworldsize) be set to allow processing within a known range.
Outside of this range, objects and polygons will not be processed as efficiently.
Excessive world size settings can also cause loss of precision and efficiency.

Setting maxworldsize should be done first before creating any geometry. It can be done any time afterwards but may be slow in this case.

See Also: System::createGeometry, System::getGeometrySettings, System::set3DSettings

System::setNetworkProxy

Set a proxy server to use for all subsequent internet connections.

C
C++
C#
JS

FMOD_RESULT System::setNetworkProxy(
  const char *proxy
);
FMOD_RESULT FMOD_System_SetNetworkProxy(
  FMOD_SYSTEM *system,
  const char *proxy
);
RESULT System.setNetworkProxy(
  string proxy
);
System.setNetworkProxy(
  proxy
);
proxy
Proxy server URL. (UTF-8 string)

Specify the proxy in host:port format e.g. www.fmod.com:8888 (defaults to port 80 if no port is specified).

Basic authentication is supported using user:password@host:port format e.g. bob:sekrit123@www.fmod.com:8888

See Also: System::getNetworkProxy

System::setNetworkTimeout

Set the timeout for network streams.

C
C++
C#
JS

FMOD_RESULT System::setNetworkTimeout(
  int timeout
);
FMOD_RESULT FMOD_System_SetNetworkTimeout(
  FMOD_SYSTEM *system,
  int timeout
);
RESULT System.setNetworkTimeout(
  int timeout
);
System.setNetworkTimeout(
  timeout
);
timeout

Timeout value.

  • Units: Milliseconds
  • Default: 5000

See Also: System::getNetworkTimeout

System::setOutput

Sets the type of output interface used to run the mixer.

C
C++
C#
JS

FMOD_RESULT System::setOutput(
  FMOD_OUTPUTTYPE output
);
FMOD_RESULT FMOD_System_SetOutput(
  FMOD_SYSTEM *system,
  FMOD_OUTPUTTYPE output
);
RESULT System.setOutput(
  OUTPUTTYPE output
);
System.setOutput(
  output
);
output
Output type. (FMOD_OUTPUTTYPE)

This function is typically used to select between different OS specific audio APIs which may have different features.

It is only necessary to call this function if you want to specifically switch away from the default output mode for the operating system. The most optimal mode is selected by default for the operating system.

(Windows, UWP, GameCore, Android, MacOS, iOS, Linux Only) This function can be called after System::init to perform special handling of driver disconnections, see FMOD_SYSTEM_CALLBACK_DEVICELISTCHANGED.

When using the Studio API, switching to an NRT (non-realtime) output type after FMOD is already initialized will not behave correctly unless the Studio API was initialized with FMOD_STUDIO_INIT_SYNCHRONOUS_UPDATE.

See Also: System::getOutput

System::setOutputByPlugin

Selects an output type given a plug-in handle.

C
C++
C#
JS

FMOD_RESULT System::setOutputByPlugin(
  unsigned int handle
);
FMOD_RESULT FMOD_System_SetOutputByPlugin(
  FMOD_SYSTEM *system,
  unsigned int handle
);
RESULT System.setOutputByPlugin(
  uint handle
);
System.setOutputByPlugin(
  handle
);
handle
Handle to an already loaded output plug-in.

(Windows Only) This function can be called after FMOD is already initialized. You can use it to change the output mode at runtime. If FMOD_SYSTEM_CALLBACK_DEVICELISTCHANGED is specified use the setOutput call to change to FMOD_OUTPUTTYPE_NOSOUND if no more sound card drivers exist.

See Also: System::getNumPlugins, System::getOutputByPlugin, System::setOutput

System::setPluginPath

Specify a base search path for plug-ins so they can be placed somewhere else than the directory of the main executable.

C
C++
C#
JS

FMOD_RESULT System::setPluginPath(
  const char *path
);
FMOD_RESULT FMOD_System_SetPluginPath(
  FMOD_SYSTEM *system,
  const char *path
);
RESULT System.setPluginPath(
  string path
);
System.setPluginPath(
  path
);
path
A character string containing a correctly formatted path to load plug-ins from. (UTF-8 string)

See Also: System::loadPlugin

System::setReverbProperties

Sets parameters for the global reverb environment.

C
C++
C#
JS

FMOD_RESULT System::setReverbProperties(
  int instance,
  const FMOD_REVERB_PROPERTIES *prop
);
FMOD_RESULT FMOD_System_SetReverbProperties(
  FMOD_SYSTEM *system,
  int instance,
  const FMOD_REVERB_PROPERTIES *prop
);
RESULT System.setReverbProperties(
  int instance,
  ref REVERB_PROPERTIES prop
);
System.setReverbProperties(
  instance,
  prop
);
instance

Index of the particular reverb instance to target.

prop
Reverb environment description. Passing 0 or NULL to this function will delete the reverb. (FMOD_REVERB_PROPERTIES)

To assist in defining reverb properties there are several presets available, see FMOD_REVERB_PRESETS

When using each instance for the first time, FMOD will create an SFX reverb DSP unit that takes up several hundred kilobytes of memory and some CPU.

See Also: System::getReverbProperties, ChannelControl::setReverbProperties, ChannelControl::getReverbProperties, Effects Reference: SFX Reverb

System::setSoftwareChannels

Sets the maximum number of software mixed Channels possible.

C
C++
C#
JS

FMOD_RESULT System::setSoftwareChannels(
  int numsoftwarechannels
);
FMOD_RESULT FMOD_System_SetSoftwareChannels(
  FMOD_SYSTEM *system,
  int numsoftwarechannels
);
RESULT System.setSoftwareChannels(
  int numsoftwarechannels
);
System.setSoftwareChannels(
  numsoftwarechannels
);
numsoftwarechannels

The maximum number of real Channels to be allocated by FMOD.

  • Default: 64

This function cannot be called after FMOD is already activated, it must be called before System::init, or after System::close.
'Software Channels' refers to real Channels that will play, with numsoftwarechannels refering to the maximum number of Channels before successive Channels start becoming virtual. For differences between real and virtual Channels see the Virtual Voices guide.

See Also: System::getSoftwareChannels, System::init, System::close

System::setSoftwareFormat

Sets the output format for the software mixer.

C
C++
C#
JS

FMOD_RESULT System::setSoftwareFormat(
  int samplerate,
  FMOD_SPEAKERMODE speakermode,
  int numrawspeakers
);
FMOD_RESULT FMOD_System_SetSoftwareFormat(
  FMOD_SYSTEM *system,
  int samplerate,
  FMOD_SPEAKERMODE speakermode,
  int numrawspeakers
);
RESULT System.setSoftwareFormat(
  int samplerate,
  SPEAKERMODE speakermode,
  int numrawspeakers
);
System.setSoftwareFormat(
  samplerate,
  speakermode,
  numrawspeakers
);
samplerate Opt

Sample rate of the mixer.

  • Range: [8000, 192000]
  • Units: Hertz
  • Default: 48000
speakermode Opt
Speaker setup of the mixer. (FMOD_SPEAKERMODE)
numrawspeakers Opt

Number of speakers for FMOD_SPEAKERMODE_RAW mode.

If loading banks made in FMOD Studio, this must be called with speakermode corresponding to the project output format if there is a possibility of the output audio device not matching the project format. Any differences between the project format and speakermode will cause the mix to sound wrong.

By default speakermode will assume the setup the OS / output prefers.

Altering the samplerate from the OS / output preferred rate may incur extra latency. Altering the speakermode from the OS / output preferred mode may cause an upmix/downmix which can alter the sound.

On lower power platforms such as mobile samplerate will default to 24 kHz to reduce CPU cost.

This function must be called before System::init, or after System::close.

See Also: System::getSoftwareFormat

System::setSpeakerPosition

Sets the position of the specified speaker for the current speaker mode.

This function allows the user to specify the position of their speaker to account for non standard setups.
It also allows the user to disable speakers from 3D consideration in a game.

C
C++
C#
JS

FMOD_RESULT System::setSpeakerPosition(
  FMOD_SPEAKER speaker,
  float x,
  float y,
  bool active
);
FMOD_RESULT FMOD_System_SetSpeakerPosition(
  FMOD_SYSTEM *system,
  FMOD_SPEAKER speaker,
  float x,
  float y,
  FMOD_BOOL active
);
RESULT System.setSpeakerPosition(
  SPEAKER speaker,
  float x,
  float y,
  bool active
);
System.setSpeakerPosition(
  speaker,
  x,
  y,
  active
);
speaker
Speaker. (FMOD_SPEAKER)
x

2D X position relative to the listener. -1 = left, 0 = middle, +1 = right.

  • Range: [-1, 1]
y

2D Y position relative to the listener. -1 = back, 0 = middle, +1 = front.

  • Range: [-1, 1]
active

Active state of a speaker. True = included in 3D calculations, False = ignored.

  • Units: Boolean

This allows you to customize the position of the speakers for the current FMOD_SPEAKERMODE by giving X (left to right) and Y (front to back) coordinates.
When disabling a speaker, 3D spatialization is redistributed around the missing speaker so that signal isn't lost.

Stereo setup would look like this:

FMOD_System_SetSpeakerPosition(system, FMOD_SPEAKER_FRONT_LEFT, -1.0f,  0.0f, 1);
FMOD_System_SetSpeakerPosition(system, FMOD_SPEAKER_FRONT_RIGHT, 1.0f,  0.0f, 1);
system->setSpeakerPosition(FMOD_SPEAKER_FRONT_LEFT, -1.0f,  0.0f, true);
system->setSpeakerPosition(FMOD_SPEAKER_FRONT_RIGHT, 1.0f,  0.0f, true);

7.1 setup would look like this:

FMOD_System_SetSpeakerPosition(system, FMOD_SPEAKER_FRONT_LEFT,     sin(degtorad( -30)), cos(degtorad( -30)), 1);
FMOD_System_SetSpeakerPosition(system, FMOD_SPEAKER_FRONT_RIGHT,    sin(degtorad(  30)), cos(degtorad(  30)), 1);
FMOD_System_SetSpeakerPosition(system, FMOD_SPEAKER_FRONT_CENTER,   sin(degtorad(   0)), cos(degtorad(   0)), 1);
FMOD_System_SetSpeakerPosition(system, FMOD_SPEAKER_LOW_FREQUENCY,  sin(degtorad(   0)), cos(degtorad(   0)), 1);
FMOD_System_SetSpeakerPosition(system, FMOD_SPEAKER_SURROUND_LEFT,  sin(degtorad( -90)), cos(degtorad( -90)), 1);
FMOD_System_SetSpeakerPosition(system, FMOD_SPEAKER_SURROUND_RIGHT, sin(degtorad(  90)), cos(degtorad(  90)), 1);
FMOD_System_SetSpeakerPosition(system, FMOD_SPEAKER_BACK_LEFT,      sin(degtorad(-150)), cos(degtorad(-150)), 1);
FMOD_System_SetSpeakerPosition(system, FMOD_SPEAKER_BACK_RIGHT,     sin(degtorad( 150)), cos(degtorad( 150)), 1);
system->setSpeakerPosition(FMOD_SPEAKER_FRONT_LEFT,     sin(degtorad( -30)), cos(degtorad( -30)), true);
system->setSpeakerPosition(FMOD_SPEAKER_FRONT_RIGHT,    sin(degtorad(  30)), cos(degtorad(  30)), true);
system->setSpeakerPosition(FMOD_SPEAKER_FRONT_CENTER,   sin(degtorad(   0)), cos(degtorad(   0)), true);
system->setSpeakerPosition(FMOD_SPEAKER_LOW_FREQUENCY,  sin(degtorad(   0)), cos(degtorad(   0)), true);
system->setSpeakerPosition(FMOD_SPEAKER_SURROUND_LEFT,  sin(degtorad( -90)), cos(degtorad( -90)), true);
system->setSpeakerPosition(FMOD_SPEAKER_SURROUND_RIGHT, sin(degtorad(  90)), cos(degtorad(  90)), true);
system->setSpeakerPosition(FMOD_SPEAKER_BACK_LEFT,      sin(degtorad(-150)), cos(degtorad(-150)), true);
system->setSpeakerPosition(FMOD_SPEAKER_BACK_RIGHT,     sin(degtorad( 150)), cos(degtorad( 150)), true);

Calling System::setSoftwareFormat will override any customization made with this function.

Users of the Studio API should be aware this function does not affect the speaker positions used by the spatializer DSPs such as the pan and object panner DSPs. It is purely for Core API spatialization via ChannelControl::set3DAttributes.

See Also: System::getSpeakerPosition

System::setStreamBufferSize

Sets the default file buffer size for newly opened streams.

C
C++
C#
JS

FMOD_RESULT System::setStreamBufferSize(
  unsigned int filebuffersize,
  FMOD_TIMEUNIT filebuffersizetype
);
FMOD_RESULT FMOD_System_SetStreamBufferSize(
  FMOD_SYSTEM *system,
  unsigned int filebuffersize,
  FMOD_TIMEUNIT filebuffersizetype
);
RESULT System.setStreamBufferSize(
  uint filebuffersize,
  TIMEUNIT filebuffersizetype
);
System.setStreamBufferSize(
  filebuffersize,
  filebuffersizetype
);
filebuffersize

Buffer size.

  • Default: 16384
filebuffersizetype

Type of units for filebuffersize. (FMOD_TIMEUNIT)

Valid units for filebuffersizetype are:

Larger values will consume more memory, whereas smaller values may cause buffer under-run / starvation / stuttering caused by large delays in disk access (ie netstream), or CPU usage in slow machines, or by trying to play too many streams at once.

Does not affect streams created with FMOD_OPENUSER, as the buffer size is specified in System::createSound.

Does not affect latency of playback. All streams are pre-buffered (unless opened with FMOD_OPENONLY), so they will always start immediately.

Seek and Play operations can sometimes cause a reflush of this buffer.

If FMOD_TIMEUNIT_RAWBYTES is used, the memory allocated is two times the size passed in, because fmod allocates a double buffer.

If FMOD_TIMEUNIT_MS, FMOD_TIMEUNIT_PCM or FMOD_TIMEUNIT_PCMBYTES is used, and the stream is infinite (such as a shoutcast netstream), or VBR, then FMOD cannot calculate an accurate compression ratio to work with when the file is opened. This means it will then base the buffersize on FMOD_TIMEUNIT_PCMBYTES, or in other words the number of PCM bytes, but this will be incorrect for some compressed formats. Use FMOD_TIMEUNIT_RAWBYTES for these type (infinite / undetermined length) of streams for more accurate read sizes.

To determine the actual memory usage of a stream, including sound buffer and other overhead, use Memory_GetStats before and after creating a sound.

Stream may still stutter if the codec uses a large amount of cpu time, which impacts the smaller, internal 'decode' buffer. The decode buffer size is changeable via FMOD_CREATESOUNDEXINFO.

See Also: System::getStreamBufferSize, Sound::getOpenState

System::setUserData

Sets a user value associated with a System object.

C
C++
C#
JS

FMOD_RESULT System::setUserData(
  void *userdata
);
FMOD_RESULT FMOD_System_SetUserData(
  FMOD_SYSTEM *system,
  void *userdata
);
RESULT System.setUserData(
  IntPtr userdata
);
System.setUserData(
  userdata
);
userdata
User specified data to be stored within the System object.

This function allows arbitrary user data to be attached to this object, which wll be passed through the userdata parameter in any FMOD_SYSTEM_CALLBACKs. See the User Data section of the glossary for an example of how to get and set user data.

See Also: System::getUserData, System::setCallback

System::unloadPlugin

Unloads an FMOD (DSP, Output or Codec) plug-in.

C
C++
C#
JS

FMOD_RESULT System::unloadPlugin(
  unsigned int handle
);
FMOD_RESULT FMOD_System_UnloadPlugin(
  FMOD_SYSTEM *system,
  unsigned int handle
);
RESULT System.unloadPlugin(
  uint handle
);
System.unloadPlugin(
  handle
);
handle
Handle to an already loaded plug-in.

See Also: System::loadPlugin

System::unlockDSP

Mutual exclusion function to unlock the DSP engine (which runs asynchronously in another thread) and let it continue executing.

C
C++
C#
JS

FMOD_RESULT System::unlockDSP();
FMOD_RESULT FMOD_System_UnlockDSP(FMOD_SYSTEM *system);
RESULT System.unlockDSP();
System.unlockDSP();

The DSP engine must be locked with System::lockDSP before this function is called.

System::update

Updates the FMOD system.

C
C++
C#
JS

FMOD_RESULT System::update();
FMOD_RESULT FMOD_System_Update(FMOD_SYSTEM *system);
RESULT System.update();
System.update();

Should be called once per 'game' tick, or once per frame in your application to perform actions such as:

If FMOD_OUTPUTTYPE_NOSOUND_NRT or FMOD_OUTPUTTYPE_WAVWRITER_NRT output modes are used, this function also drives the software / DSP engine, instead of it running asynchronously in a thread as is the default behavior.
This can be used for faster than realtime updates to the decoding or DSP engine which might be useful if the output is the wav writer for example.

If FMOD_INIT_STREAM_FROM_UPDATE is used, this function will update the stream engine. Combining this with the non realtime output will mean smoother captured output.

See Also: System::init, FMOD_INITFLAGS, FMOD_OUTPUTTYPE, FMOD_MODE