Core API Reference | Common

7. Core API Reference | Common

File:

  • File_GetDiskBusy Information function to retrieve the state of FMOD disk access.
  • File_SetDiskBusy Sets the busy state for disk access ensuring mutual exclusion of file operations.

Memory:

  • Memory_GetStats Returns information on the memory usage of FMOD.
  • Memory_Initialize Specifies a method for FMOD to allocate and free memory, either through user supplied callbacks or through a user supplied memory memory buffer with a fixed size.


  • FMOD_MEMORY_TYPE Bitfields for memory allocation type being passed into FMOD memory callbacks.

Debugging:

  • Debug_Initialize Specify the level and delivery method of log messages when using the logging version of FMOD.


  • FMOD_DEBUG_MODE Specify the destination of log output when using the logging version of FMOD.
  • FMOD_DEBUG_FLAGS Specify the requested information to be output when using the logging version of FMOD.

General:


FMOD_3D_ATTRIBUTES

Structure describing a position, velocity and orientation.

C
C++
C#
JS

typedef struct FMOD_3D_ATTRIBUTES {
  FMOD_VECTOR position;
  FMOD_VECTOR velocity;
  FMOD_VECTOR forward;
  FMOD_VECTOR up;
} FMOD_3D_ATTRIBUTES;
position

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

velocity

Velocity in world space used for doppler. (FMOD_VECTOR)

forward
Forwards orientation, must be of unit length (1.0) and perpendicular to up. (FMOD_VECTOR)
up
Upwards orientation, must be of unit length (1.0) and perpendicular to forward. (FMOD_VECTOR)

Vectors must be provided in the correct handedness.

See Also: FMOD_DSP_PARAMETER_3DATTRIBUTES

FMOD_CHANNELMASK

Flags that describe the speakers present in a given signal.

C
C++
C#
JS

#define FMOD_CHANNELMASK_FRONT_LEFT       0x00000001
#define FMOD_CHANNELMASK_FRONT_RIGHT      0x00000002
#define FMOD_CHANNELMASK_FRONT_CENTER     0x00000004
#define FMOD_CHANNELMASK_LOW_FREQUENCY    0x00000008
#define FMOD_CHANNELMASK_SURROUND_LEFT    0x00000010
#define FMOD_CHANNELMASK_SURROUND_RIGHT   0x00000020
#define FMOD_CHANNELMASK_BACK_LEFT        0x00000040
#define FMOD_CHANNELMASK_BACK_RIGHT       0x00000080
#define FMOD_CHANNELMASK_BACK_CENTER      0x00000100
#define FMOD_CHANNELMASK_MONO             (FMOD_CHANNELMASK_FRONT_LEFT)
#define FMOD_CHANNELMASK_STEREO           (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT)
#define FMOD_CHANNELMASK_LRC              (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER)
#define FMOD_CHANNELMASK_QUAD             (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT)
#define FMOD_CHANNELMASK_SURROUND         (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT)
#define FMOD_CHANNELMASK_5POINT1          (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_LOW_FREQUENCY | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT)
#define FMOD_CHANNELMASK_5POINT1_REARS    (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_LOW_FREQUENCY | FMOD_CHANNELMASK_BACK_LEFT | FMOD_CHANNELMASK_BACK_RIGHT)
#define FMOD_CHANNELMASK_7POINT0          (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT | FMOD_CHANNELMASK_BACK_LEFT | FMOD_CHANNELMASK_BACK_RIGHT)
#define FMOD_CHANNELMASK_7POINT1          (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_LOW_FREQUENCY | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT | FMOD_CHANNELMASK_BACK_LEFT | FMOD_CHANNELMASK_BACK_RIGHT)
FMOD_CHANNELMASK_FRONT_LEFT
Front left channel.
FMOD_CHANNELMASK_FRONT_RIGHT
Front right channel.
FMOD_CHANNELMASK_FRONT_CENTER
Front center channel.
FMOD_CHANNELMASK_LOW_FREQUENCY
Low frequency channel.
FMOD_CHANNELMASK_SURROUND_LEFT
Surround left channel.
FMOD_CHANNELMASK_SURROUND_RIGHT
Surround right channel.
FMOD_CHANNELMASK_BACK_LEFT
Back left channel.
FMOD_CHANNELMASK_BACK_RIGHT
Back right channel.
FMOD_CHANNELMASK_BACK_CENTER
Back center channel, not represented in any FMOD_SPEAKERMODE.
FMOD_CHANNELMASK_MONO
Mono channel mask.
FMOD_CHANNELMASK_STEREO
Stereo channel mask.
FMOD_CHANNELMASK_LRC
Left / right / center channel mask.
FMOD_CHANNELMASK_QUAD
Quadphonic channel mask.
FMOD_CHANNELMASK_SURROUND
5.0 surround channel mask.
FMOD_CHANNELMASK_5POINT1
5.1 surround channel mask.
FMOD_CHANNELMASK_5POINT1_REARS
5.1 surround channel mask, using rears instead of surrounds.
FMOD_CHANNELMASK_7POINT0
7.0 surround channel mask.
FMOD_CHANNELMASK_7POINT1
7.1 surround channel mask.

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

FMOD_CHANNELORDER

Speaker ordering for multichannel signals.

C
C++
C#
JS

typedef enum FMOD_CHANNELORDER {
  FMOD_CHANNELORDER_DEFAULT,
  FMOD_CHANNELORDER_WAVEFORMAT,
  FMOD_CHANNELORDER_PROTOOLS,
  FMOD_CHANNELORDER_ALLMONO,
  FMOD_CHANNELORDER_ALLSTEREO,
  FMOD_CHANNELORDER_ALSA,
  FMOD_CHANNELORDER_MAX
} FMOD_CHANNELORDER;
FMOD_CHANNELORDER_DEFAULT
Left, Right, Center, LFE, Surround Left, Surround Right, Back Left, Back Right (see FMOD_SPEAKER enumeration)
FMOD_CHANNELORDER_WAVEFORMAT
Left, Right, Center, LFE, Back Left, Back Right, Surround Left, Surround Right (as per Microsoft .wav WAVEFORMAT structure master order)
FMOD_CHANNELORDER_PROTOOLS
Left, Center, Right, Surround Left, Surround Right, LFE
FMOD_CHANNELORDER_ALLMONO
Mono, Mono, Mono, Mono, Mono, Mono, ... (each channel up to FMOD_MAX_CHANNEL_WIDTH treated as mono)
FMOD_CHANNELORDER_ALLSTEREO
Left, Right, Left, Right, Left, Right, ... (each pair of channels up to FMOD_MAX_CHANNEL_WIDTH treated as stereo)
FMOD_CHANNELORDER_ALSA
Left, Right, Surround Left, Surround Right, Center, LFE (as per Linux ALSA channel order)
FMOD_CHANNELORDER_MAX
Maximum number of channel orderings supported.

See Also: FMOD_CREATESOUNDEXINFO

FMOD_DEBUG_CALLBACK

Callback for debug messages when using the logging version of FMOD.

C
C++
C#
JS

FMOD_RESULT F_CALLBACK FMOD_DEBUG_CALLBACK(
  FMOD_DEBUG_FLAGS flags,
  const char *file,
  int line,
  const char *func,
  const char *message
);
flags
Flags which detail the level and type of this log. (FMOD_DEBUG_FLAGS)
file
Source code file name where the message originated. (UTF-8 string)
line
Source code line number where the message originated.
func
Class and function name where the message originated. (UTF-8 string)
message
Actual debug message associated with the callback. (UTF-8 string)

This callback will fire directly from the log line, as such it can be from any thread.

See Also: Debug_Initialize

FMOD_DEBUG_FLAGS

Specify the requested information to be output when using the logging version of FMOD.

C
C++
C#
JS

#define FMOD_DEBUG_LEVEL_NONE            0x00000000
#define FMOD_DEBUG_LEVEL_ERROR           0x00000001
#define FMOD_DEBUG_LEVEL_WARNING         0x00000002
#define FMOD_DEBUG_LEVEL_LOG             0x00000004
#define FMOD_DEBUG_TYPE_MEMORY           0x00000100
#define FMOD_DEBUG_TYPE_FILE             0x00000200
#define FMOD_DEBUG_TYPE_CODEC            0x00000400
#define FMOD_DEBUG_TYPE_TRACE            0x00000800
#define FMOD_DEBUG_DISPLAY_TIMESTAMPS    0x00010000
#define FMOD_DEBUG_DISPLAY_LINENUMBERS   0x00020000
#define FMOD_DEBUG_DISPLAY_THREAD        0x00040000
FMOD_DEBUG_LEVEL_NONE
Disable all messages.
FMOD_DEBUG_LEVEL_ERROR
Enable only error messages.
FMOD_DEBUG_LEVEL_WARNING
Enable warning and error messages.
FMOD_DEBUG_LEVEL_LOG
Enable informational, warning and error messages (default).
FMOD_DEBUG_TYPE_MEMORY
Verbose logging for memory operations, only use this if you are debugging a memory related issue.
FMOD_DEBUG_TYPE_FILE
Verbose logging for file access, only use this if you are debugging a file related issue.
FMOD_DEBUG_TYPE_CODEC
Verbose logging for codec initialization, only use this if you are debugging a codec related issue.
FMOD_DEBUG_TYPE_TRACE
Verbose logging for internal errors, use this for tracking the origin of error codes.
FMOD_DEBUG_DISPLAY_TIMESTAMPS
Display the time stamp of the log message in milliseconds.
FMOD_DEBUG_DISPLAY_LINENUMBERS
Display the source code file and line number for where the message originated.
FMOD_DEBUG_DISPLAY_THREAD
Display the thread ID of the calling function that generated the message.

See Also: Debug_Initialize

Debug_Initialize

Specify the level and delivery method of log messages when using the logging version of FMOD.

C
C++
C#
JS

FMOD_RESULT Debug_Initialize(
  FMOD_DEBUG_FLAGS flags,
  FMOD_DEBUG_MODE mode = FMOD_DEBUG_MODE_TTY,
  FMOD_DEBUG_CALLBACK callback = 0,
  const char *filename = nullptr
);
flags
Debug level, type and display control flags. More than one mode can be set at once by combining them with the OR operator. (FMOD_DEBUG_FLAGS)
mode Opt
Destination for log messages. (FMOD_DEBUG_MODE)
callback Opt
Callback to use when mode is set to callback, only required when using that mode. (FMOD_DEBUG_CALLBACK)
filename Opt
Filename to use when mode is set to file, only required when using that mode. (UTF-8 string)

This function will return FMOD_ERR_UNSUPPORTED when using the non-logging (release) versions of FMOD.

The logging version of FMOD can be recognized by the 'L' suffix in the library name, fmodL.dll or libfmodL.so for instance.

Note that:

See Also: Callback Behavior

FMOD_DEBUG_MODE

Specify the destination of log output when using the logging version of FMOD.

C
C++
C#
JS

typedef enum FMOD_DEBUG_MODE {
  FMOD_DEBUG_MODE_TTY,
  FMOD_DEBUG_MODE_FILE,
  FMOD_DEBUG_MODE_CALLBACK
} FMOD_DEBUG_MODE;
FMOD_DEBUG_MODE_TTY
Default log location per platform, i.e. Visual Studio output window, stderr, LogCat, etc.
FMOD_DEBUG_MODE_FILE
Write log to specified file path.
FMOD_DEBUG_MODE_CALLBACK
Call specified callback with log information.

TTY destination can vary depending on platform, common examples include the Visual Studio / Xcode output window, stderr and LogCat.

See Also: Debug_Initialize

File_GetDiskBusy

Information function to retrieve the state of FMOD disk access.

C
C++
C#
JS

FMOD_RESULT File_GetDiskBusy(
  int *busy
);
busy Out
Busy state of the disk at the current time.

Do not use this function to synchronize your own reads with, as due to timing, you might call this function and it says false = it is not busy, but the split second after call this function, internally FMOD might set it to busy. Use File_SetDiskBusy for proper mutual exclusion as it uses semaphores.

See Also: File_SetDiskBusy

File_SetDiskBusy

Sets the busy state for disk access ensuring mutual exclusion of file operations.

C
C++
C#
JS

FMOD_RESULT File_SetDiskBusy(
  int busy
);
busy
Busy state where 1 represent the begining of disk access and 0 represents the end of disk access.

If file IO is currently being performed by FMOD this function will block until it has completed.

This function should be called in pairs once to set the state, then again to clear it once complete.

See Also: File_GetDiskBusy

FMOD_GUID

Structure describing a globally unique identifier.

C
C++
C#
JS

typedef struct FMOD_GUID {
  unsigned int     Data1;
  unsigned short   Data2;
  unsigned short   Data3;
  unsigned char    Data4[8];
} FMOD_GUID;
Data1
Specifies the first 8 hexadecimal digits of the GUID.
Data2
Specifies the first group of 4 hexadecimal digits.
Data3
Specifies the second group of 4 hexadecimal digits.
Data4
Array of 8 bytes. The first 2 bytes contain the third group of 4 hexadecimal digits. The remaining 6 bytes contain the final 12 hexadecimal digits.

See Also: System::getDriverInfo

FMOD_MAX_CHANNEL_WIDTH

Maximum number of channels per frame of audio supported by audio files, buffers, connections and DSPs.

C
C++
C#
JS

#define FMOD_MAX_CHANNEL_WIDTH 32
FMOD_MAX_CHANNEL_WIDTH
Maximum number of channels.

See Also: System::setSoftwareFormat, ChannelControl::setMixMatrix, DSP::setChannelFormat

FMOD_MAX_LISTENERS

Maximum number of listeners supported.

C
C++
C#
JS

#define FMOD_MAX_LISTENERS 8
FMOD_MAX_LISTENERS
Maximum listeners.

See Also: System::set3DNumListeners, System::set3DListenerAttributes

FMOD_MAX_SYSTEMS

Maximum number of System objects allowed.

C
C++
C#
JS

#define FMOD_MAX_SYSTEMS 8
FMOD_MAX_SYSTEMS
Maximum System objects.

See Also: System_Create

FMOD_MEMORY_ALLOC_CALLBACK

Callback to allocate a block of memory.

C
C++
C#
JS

void * F_CALLBACK FMOD_MEMORY_ALLOC_CALLBACK(
  unsigned int size,
  FMOD_MEMORY_TYPE type,
  const char *sourcestr
);
size

Size of the memory block to be allocated and returned.

  • Units: Bytes
type
Type of memory allocation. (FMOD_MEMORY_TYPE)
sourcestr Opt
String with the FMOD source code filename and line number in it. Only valid in logging versions of FMOD. (UTF-8 string)

Returning an aligned pointer, of 16 byte alignment is recommended for performance reasons.

See Also: Memory_Initialize, Memory_GetStats, FMOD_MEMORY_REALLOC_CALLBACK, FMOD_MEMORY_FREE_CALLBACK

FMOD_MEMORY_FREE_CALLBACK

Callback to free a block of memory.

C
C++
C#
JS

void F_CALLBACK FMOD_MEMORY_FREE_CALLBACK(
  void *ptr,
  FMOD_MEMORY_TYPE type,
  const char *sourcestr
);
ptr
Pre-existing block of memory to be freed.
type
Type of memory to be freed. (FMOD_MEMORY_TYPE)
sourcestr
String with the FMOD source code filename and line number in it. Only valid in logging versions of FMOD. (UTF-8 string)

See Also: Memory_Initialize, FMOD_MEMORY_ALLOC_CALLBACK, FMOD_MEMORY_REALLOC_CALLBACK

Memory_GetStats

Returns information on the memory usage of FMOD.

C
C++
C#
JS

FMOD_RESULT Memory_GetStats(
  int *currentalloced,
  int *maxalloced,
  bool blocking = true
);
currentalloced OutOpt
Currently allocated memory at time of call.
maxalloced OutOpt
Maximum allocated memory since System::init or Memory_Initialize.
blocking

Flag to indicate whether to favour speed or accuracy. Specifying true for this parameter will flush the DSP network to make sure all queued allocations happen immediately, which can be costly.

  • Units: Boolean

This information is byte accurate and counts all allocs and frees internally. This is useful for determining a fixed memory size to make FMOD work within for fixed memory machines such as consoles.

Note that if using Memory_Initialize, the memory usage will be slightly higher than without it, as FMOD has to have a small amount of memory overhead to manage the available memory.

Memory_Initialize

Specifies a method for FMOD to allocate and free memory, either through user supplied callbacks or through a user supplied memory memory buffer with a fixed size.

C
C++
C#
JS

FMOD_RESULT Memory_Initialize(
  void *poolmem,
  int poollen,
  FMOD_MEMORY_ALLOC_CALLBACK useralloc,
  FMOD_MEMORY_REALLOC_CALLBACK userrealloc,
  FMOD_MEMORY_FREE_CALLBACK userfree,
  FMOD_MEMORY_TYPE memtypeflags = FMOD_MEMORY_ALL
);
poolmem Opt
Block of memory of size poollen bytes for FMOD to manage, mutually exclusive with useralloc / userrealloc / userfree.
poollen Opt

Size of poolmem, must be a multiple of 512.

  • Units: Bytes
useralloc Opt
Memory allocation callback compatible with ANSI malloc, mutually exclusive with poolmem. (FMOD_MEMORY_ALLOC_CALLBACK)
userrealloc Opt
Memory reallocation callback compatible with ANSI realloc, mutually exclusive with poolmem. (FMOD_MEMORY_REALLOC_CALLBACK)
userfree Opt
Memory free callback compatible with ANSI free, mutually exclusive with poolmem. (FMOD_MEMORY_FREE_CALLBACK)
memtypeflags Opt
Types of memory callbacks you wish to handle. OR these together to handle multiple types. (FMOD_MEMORY_TYPE)

This function must be called before any FMOD System object is created.

Valid usage of this function requires either poolmem and poollen or useralloc, userrealloc and userfree being set.

To find out the required fixed size call Memory_Initialize with an overly large pool size (or no pool) and find out the maximum RAM usage at any one time with Memory_GetStats.

Callback implementations must be thread safe.

If you specify a fixed size pool that is too small, FMOD will return FMOD_ERR_MEMORY when the limit of the fixed size pool is exceeded. At this point, it's possible that FMOD may become unstable. To maintain stability, do not allow FMOD to run out of memory.

See Also: Callback Behavior

FMOD_MEMORY_REALLOC_CALLBACK

Callback to re-allocate a block of memory to a different size.

C
C++
C#
JS

void * F_CALLBACK FMOD_MEMORY_REALLOC_CALLBACK(
  void *ptr,
  unsigned int size,
  FMOD_MEMORY_TYPE type,
  const char *sourcestr
);
ptr
Block of memory to be resized. If this is null, then a new block of memory is allocated and no memory is freed.
size

Size of the memory to be reallocated.

  • Units: Bytes
type
Memory allocation type. (FMOD_MEMORY_TYPE)
sourcestr
String with the FMOD source code filename and line number in it. Only valid in logging versions of FMOD. (UTF-8 string)

When allocating new memory, the contents of the old memory block must be preserved.

Returning an aligned pointer, of 16 byte alignment is recommended for performance reasons.

See Also: Memory_Initialize, Memory_GetStats, FMOD_MEMORY_ALLOC_CALLBACK, FMOD_MEMORY_FREE_CALLBACK

FMOD_MEMORY_TYPE

Bitfields for memory allocation type being passed into FMOD memory callbacks.

C
C++
C#
JS

#define FMOD_MEMORY_NORMAL             0x00000000
#define FMOD_MEMORY_STREAM_FILE        0x00000001
#define FMOD_MEMORY_STREAM_DECODE      0x00000002
#define FMOD_MEMORY_SAMPLEDATA         0x00000004
#define FMOD_MEMORY_DSP_BUFFER         0x00000008
#define FMOD_MEMORY_PLUGIN             0x00000010
#define FMOD_MEMORY_PERSISTENT         0x00200000
#define FMOD_MEMORY_ALL                0xFFFFFFFF
FMOD_MEMORY_NORMAL
Standard memory.
FMOD_MEMORY_STREAM_FILE
Stream file buffer, size controllable with System::setStreamBufferSize.
FMOD_MEMORY_STREAM_DECODE
Stream decode buffer, size controllable with FMOD_CREATESOUNDEXINFO::decodebuffersize.
FMOD_MEMORY_SAMPLEDATA
Sample data buffer. Raw audio data, usually PCM/MPEG/ADPCM/XMA data.
FMOD_MEMORY_DSP_BUFFER
Deprecated.
FMOD_MEMORY_PLUGIN
Memory allocated by a third party plugin.
FMOD_MEMORY_PERSISTENT
Persistent memory. Memory will be freed when System::release is called.
FMOD_MEMORY_ALL
Mask specifying all memory types.

See Also: FMOD_MEMORY_ALLOC_CALLBACK, FMOD_MEMORY_REALLOC_CALLBACK, FMOD_MEMORY_FREE_CALLBACK, Memory_Initialize

FMOD_MODE

Sound description bitfields, bitwise OR them together for loading and describing sounds.

C
C++
C#
JS

#define FMOD_DEFAULT                    0x00000000
#define FMOD_LOOP_OFF                   0x00000001
#define FMOD_LOOP_NORMAL                0x00000002
#define FMOD_LOOP_BIDI                  0x00000004
#define FMOD_2D                         0x00000008
#define FMOD_3D                         0x00000010
#define FMOD_CREATESTREAM               0x00000080
#define FMOD_CREATESAMPLE               0x00000100
#define FMOD_CREATECOMPRESSEDSAMPLE     0x00000200
#define FMOD_OPENUSER                   0x00000400
#define FMOD_OPENMEMORY                 0x00000800
#define FMOD_OPENMEMORY_POINT           0x10000000
#define FMOD_OPENRAW                    0x00001000
#define FMOD_OPENONLY                   0x00002000
#define FMOD_ACCURATETIME               0x00004000
#define FMOD_MPEGSEARCH                 0x00008000
#define FMOD_NONBLOCKING                0x00010000
#define FMOD_UNIQUE                     0x00020000
#define FMOD_3D_HEADRELATIVE            0x00040000
#define FMOD_3D_WORLDRELATIVE           0x00080000
#define FMOD_3D_INVERSEROLLOFF          0x00100000
#define FMOD_3D_LINEARROLLOFF           0x00200000
#define FMOD_3D_LINEARSQUAREROLLOFF     0x00400000
#define FMOD_3D_INVERSETAPEREDROLLOFF   0x00800000
#define FMOD_3D_CUSTOMROLLOFF           0x04000000
#define FMOD_3D_IGNOREGEOMETRY          0x40000000
#define FMOD_IGNORETAGS                 0x02000000
#define FMOD_LOWMEM                     0x08000000
#define FMOD_VIRTUAL_PLAYFROMSTART      0x80000000
FMOD_DEFAULT
Default for all modes listed below. FMOD_LOOP_OFF, FMOD_2D, FMOD_3D_WORLDRELATIVE, FMOD_3D_INVERSEROLLOFF
FMOD_LOOP_OFF
For non looping sounds. (DEFAULT). Overrides FMOD_LOOP_NORMAL / FMOD_LOOP_BIDI.
FMOD_LOOP_NORMAL
For forward looping sounds.
FMOD_LOOP_BIDI
For bidirectional looping sounds. (only works on software mixed static sounds).
FMOD_2D
Ignores any 3d processing. (DEFAULT).
FMOD_3D
Makes the sound positionable in 3D. Overrides FMOD_2D.
FMOD_CREATESTREAM
Decompress at runtime, streaming from the source provided (ie from disk). Overrides FMOD_CREATESAMPLE and FMOD_CREATECOMPRESSEDSAMPLE. Note a stream can only be played once at a time due to a stream only having 1 stream buffer and file handle. Open multiple streams to have them play concurrently.
FMOD_CREATESAMPLE
Decompress at loadtime, decompressing or decoding whole file into memory as the target sample format (ie PCM). Fastest for playback and most flexible.
FMOD_CREATECOMPRESSEDSAMPLE
Load MP2/MP3/FADPCM/IMAADPCM/Vorbis/AT9 or XMA into memory and leave it compressed. Vorbis/AT9/FADPCM encoding only supported in the .FSB container format. During playback the FMOD software mixer will decode it in realtime as a 'compressed sample'. Overrides FMOD_CREATESAMPLE. If the sound data is not one of the supported formats, it will behave as if it was created with FMOD_CREATESAMPLE and decode the sound into PCM.
FMOD_OPENUSER
Opens a user created static sample or stream. Use FMOD_CREATESOUNDEXINFO to specify format, defaultfrequency, numchannels, and optionally a read callback. If a user created 'sample' is created with no read callback, the sample will be empty. Use Sound::lock and Sound::unlock to place sound data into the sound if this is the case.
FMOD_OPENMEMORY
"name_or_data" will be interpreted as a pointer to memory instead of filename for creating sounds. Use FMOD_CREATESOUNDEXINFO to specify length. If used with FMOD_CREATESAMPLE or FMOD_CREATECOMPRESSEDSAMPLE, FMOD duplicates the memory into its own buffers. Your own buffer can be freed after open, unless you are using FMOD_NONBLOCKING then wait until the Sound is in the FMOD_OPENSTATE_READY state. If used with FMOD_CREATESTREAM, FMOD will stream out of the buffer whose pointer you passed in. In this case, your own buffer should not be freed until you have finished with and released the stream.
FMOD_OPENMEMORY_POINT
"name_or_data" will be interpreted as a pointer to memory instead of filename for creating sounds. Use FMOD_CREATESOUNDEXINFO to specify length. This differs to FMOD_OPENMEMORY in that it uses the memory as is, without duplicating the memory into its own buffers. Cannot be freed after open, only after Sound::release. Will not work if the data is compressed and FMOD_CREATECOMPRESSEDSAMPLE is not used. Cannot be used in conjunction with FMOD_CREATESOUNDEXINFO::encryptionkey.
FMOD_OPENRAW
Will ignore file format and treat as raw pcm. Use FMOD_CREATESOUNDEXINFO to specify format. Requires at least defaultfrequency, numchannels and format to be specified before it will open. Must be little endian data.
FMOD_OPENONLY
Just open the file, dont prebuffer or read. Good for fast opens for info, or when sound::readData is to be used.
FMOD_ACCURATETIME
For System::createSound - for accurate Sound::getLength / Channel::setPosition on VBR MP3, and MOD/S3M/XM/IT/MIDI files. Scans file first, so takes longer to open. FMOD_OPENONLY does not affect this.
FMOD_MPEGSEARCH
For corrupted / bad MP3 files. This will search all the way through the file until it hits a valid MPEG header. Normally only searches for 4k.
FMOD_NONBLOCKING
For opening sounds and getting streamed subsounds (seeking) asynchronously. Use Sound::getOpenState to poll the state of the sound as it opens or retrieves the subsound in the background.
FMOD_UNIQUE
Unique sound, can only be played one at a time
FMOD_3D_HEADRELATIVE
Make the sound's position, velocity and orientation relative to the listener.
FMOD_3D_WORLDRELATIVE
Make the sound's position, velocity and orientation absolute (relative to the world). (DEFAULT)
FMOD_3D_INVERSEROLLOFF
This sound will follow the inverse rolloff model where mindistance = full volume, maxdistance = where sound stops attenuating, and rolloff is fixed according to the global rolloff factor. (DEFAULT)
FMOD_3D_LINEARROLLOFF
This sound will follow a linear rolloff model where mindistance = full volume, maxdistance = silence.
FMOD_3D_LINEARSQUAREROLLOFF
This sound will follow a linear-square rolloff model where mindistance = full volume, maxdistance = silence.
FMOD_3D_INVERSETAPEREDROLLOFF
This sound will follow the inverse rolloff model at distances close to mindistance and a linear-square rolloff close to maxdistance.
FMOD_3D_CUSTOMROLLOFF
This sound will follow a rolloff model defined by Sound::set3DCustomRolloff / ChannelControl::set3DCustomRolloff.
FMOD_3D_IGNOREGEOMETRY
Is not affect by geometry occlusion. If not specified in Sound::setMode, or Channel::setMode, the flag is cleared and it is affected by geometry again.
FMOD_IGNORETAGS
Skips id3v2/asf/etc tag checks when opening a sound, to reduce seek/read overhead when opening files.
FMOD_LOWMEM
Removes some features from samples to give a lower memory overhead, like Sound::getName.
FMOD_VIRTUAL_PLAYFROMSTART
For sounds that start virtual (due to being quiet or low importance), instead of swapping back to audible, and playing at the correct offset according to time, this flag makes the sound play from the start.

By default a sound will open as a static sound that is decompressed fully into memory to PCM. (ie equivalent of FMOD_CREATESAMPLE) To have a sound stream instead, use FMOD_CREATESTREAM, or use the wrapper function System::createStream.

Some opening modes (ie FMOD_OPENUSER, FMOD_OPENMEMORY, FMOD_OPENMEMORY_POINT, FMOD_OPENRAW) will need extra information. This can be provided using the FMOD_CREATESOUNDEXINFO structure.

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, for PCM formats, only WAV, FSB, and RAW are supported. For compressed formats, only those formats supported by FMOD_CREATECOMPRESSEDSAMPLE are supported.

With FMOD_OPENMEMORY_POINT and FMOD_OPENRAW or PCM, if using them together, note that you must pad the data on each side by 16 bytes. This is so fmod can modify the ends of the data for looping / interpolation / mixing purposes. If a wav file, you will need to insert silence, and then reset loop points to stop the playback from playing that silence.

See Also: System::createSound, System::createStream, Sound::setMode, ChannelControl::setMode

FMOD_RESULT

Error codes returned from every function.

C
C++
C#
JS

typedef enum FMOD_RESULT {
  FMOD_OK,
  FMOD_ERR_BADCOMMAND,
  FMOD_ERR_CHANNEL_ALLOC,
  FMOD_ERR_CHANNEL_STOLEN,
  FMOD_ERR_DMA,
  FMOD_ERR_DSP_CONNECTION,
  FMOD_ERR_DSP_DONTPROCESS,
  FMOD_ERR_DSP_FORMAT,
  FMOD_ERR_DSP_INUSE,
  FMOD_ERR_DSP_NOTFOUND,
  FMOD_ERR_DSP_RESERVED,
  FMOD_ERR_DSP_SILENCE,
  FMOD_ERR_DSP_TYPE,
  FMOD_ERR_FILE_BAD,
  FMOD_ERR_FILE_COULDNOTSEEK,
  FMOD_ERR_FILE_DISKEJECTED,
  FMOD_ERR_FILE_EOF,
  FMOD_ERR_FILE_ENDOFDATA,
  FMOD_ERR_FILE_NOTFOUND,
  FMOD_ERR_FORMAT,
  FMOD_ERR_HEADER_MISMATCH,
  FMOD_ERR_HTTP,
  FMOD_ERR_HTTP_ACCESS,
  FMOD_ERR_HTTP_PROXY_AUTH,
  FMOD_ERR_HTTP_SERVER_ERROR,
  FMOD_ERR_HTTP_TIMEOUT,
  FMOD_ERR_INITIALIZATION,
  FMOD_ERR_INITIALIZED,
  FMOD_ERR_INTERNAL,
  FMOD_ERR_INVALID_FLOAT,
  FMOD_ERR_INVALID_HANDLE,
  FMOD_ERR_INVALID_PARAM,
  FMOD_ERR_INVALID_POSITION,
  FMOD_ERR_INVALID_SPEAKER,
  FMOD_ERR_INVALID_SYNCPOINT,
  FMOD_ERR_INVALID_THREAD,
  FMOD_ERR_INVALID_VECTOR,
  FMOD_ERR_MAXAUDIBLE,
  FMOD_ERR_MEMORY,
  FMOD_ERR_MEMORY_CANTPOINT,
  FMOD_ERR_NEEDS3D,
  FMOD_ERR_NEEDSHARDWARE,
  FMOD_ERR_NET_CONNECT,
  FMOD_ERR_NET_SOCKET_ERROR,
  FMOD_ERR_NET_URL,
  FMOD_ERR_NET_WOULD_BLOCK,
  FMOD_ERR_NOTREADY,
  FMOD_ERR_OUTPUT_ALLOCATED,
  FMOD_ERR_OUTPUT_CREATEBUFFER,
  FMOD_ERR_OUTPUT_DRIVERCALL,
  FMOD_ERR_OUTPUT_FORMAT,
  FMOD_ERR_OUTPUT_INIT,
  FMOD_ERR_OUTPUT_NODRIVERS,
  FMOD_ERR_PLUGIN,
  FMOD_ERR_PLUGIN_MISSING,
  FMOD_ERR_PLUGIN_RESOURCE,
  FMOD_ERR_PLUGIN_VERSION,
  FMOD_ERR_RECORD,
  FMOD_ERR_REVERB_CHANNELGROUP,
  FMOD_ERR_REVERB_INSTANCE,
  FMOD_ERR_SUBSOUNDS,
  FMOD_ERR_SUBSOUND_ALLOCATED,
  FMOD_ERR_SUBSOUND_CANTMOVE,
  FMOD_ERR_TAGNOTFOUND,
  FMOD_ERR_TOOMANYCHANNELS,
  FMOD_ERR_TRUNCATED,
  FMOD_ERR_UNIMPLEMENTED,
  FMOD_ERR_UNINITIALIZED,
  FMOD_ERR_UNSUPPORTED,
  FMOD_ERR_VERSION,
  FMOD_ERR_EVENT_ALREADY_LOADED,
  FMOD_ERR_EVENT_LIVEUPDATE_BUSY,
  FMOD_ERR_EVENT_LIVEUPDATE_MISMATCH,
  FMOD_ERR_EVENT_LIVEUPDATE_TIMEOUT,
  FMOD_ERR_EVENT_NOTFOUND,
  FMOD_ERR_STUDIO_UNINITIALIZED,
  FMOD_ERR_STUDIO_NOT_LOADED,
  FMOD_ERR_INVALID_STRING,
  FMOD_ERR_ALREADY_LOCKED,
  FMOD_ERR_NOT_LOCKED,
  FMOD_ERR_RECORD_DISCONNECTED,
  FMOD_ERR_TOOMANYSAMPLES
} FMOD_RESULT;
FMOD_OK
No errors.
FMOD_ERR_BADCOMMAND
Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound).
FMOD_ERR_CHANNEL_ALLOC
Error trying to allocate a channel.
FMOD_ERR_CHANNEL_STOLEN
The specified channel has been reused to play another sound.
FMOD_ERR_DMA
DMA Failure. See debug output for more information.
FMOD_ERR_DSP_CONNECTION
DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts.
FMOD_ERR_DSP_DONTPROCESS
DSP return code from a DSP process query callback. Tells mixer not to call the process callback and therefore not consume CPU. Use this to optimize the DSP graph.
FMOD_ERR_DSP_FORMAT
DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format, or a matrix may have been set with the wrong size if the target unit has a specified channel map.
FMOD_ERR_DSP_INUSE
DSP is already in the mixer's DSP network. It must be removed before being reinserted or released.
FMOD_ERR_DSP_NOTFOUND
DSP connection error. Couldn't find the DSP unit specified.
FMOD_ERR_DSP_RESERVED
DSP operation error. Cannot perform operation on this DSP as it is reserved by the system.
FMOD_ERR_DSP_SILENCE
DSP return code from a DSP process query callback. Tells mixer silence would be produced from read, so go idle and not consume CPU. Use this to optimize the DSP graph.
FMOD_ERR_DSP_TYPE
DSP operation cannot be performed on a DSP of this type.
FMOD_ERR_FILE_BAD
Error loading file.
FMOD_ERR_FILE_COULDNOTSEEK
Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format.
FMOD_ERR_FILE_DISKEJECTED
Media was ejected while reading.
FMOD_ERR_FILE_EOF
End of file unexpectedly reached while trying to read essential data (truncated?).
FMOD_ERR_FILE_ENDOFDATA
End of current chunk reached while trying to read data.
FMOD_ERR_FILE_NOTFOUND
File not found.
FMOD_ERR_FORMAT
Unsupported file or audio format.
FMOD_ERR_HEADER_MISMATCH
There is a version mismatch between the FMOD header and either the FMOD Studio library or the FMOD Core library.
FMOD_ERR_HTTP
A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere.
FMOD_ERR_HTTP_ACCESS
The specified resource requires authentication or is forbidden.
FMOD_ERR_HTTP_PROXY_AUTH
Proxy authentication is required to access the specified resource.
FMOD_ERR_HTTP_SERVER_ERROR
A HTTP server error occurred.
FMOD_ERR_HTTP_TIMEOUT
The HTTP request timed out.
FMOD_ERR_INITIALIZATION
FMOD was not initialized correctly to support this function.
FMOD_ERR_INITIALIZED
Cannot call this command after System::init.
FMOD_ERR_INTERNAL
An error occurred that wasn't supposed to. Contact support.
FMOD_ERR_INVALID_FLOAT
Value passed in was a NaN, Inf or denormalized float.
FMOD_ERR_INVALID_HANDLE
An invalid object handle was used.
FMOD_ERR_INVALID_PARAM
An invalid parameter was passed to this function.
FMOD_ERR_INVALID_POSITION
An invalid seek position was passed to this function.
FMOD_ERR_INVALID_SPEAKER
An invalid speaker was passed to this function based on the current speaker mode.
FMOD_ERR_INVALID_SYNCPOINT
The syncpoint did not come from this sound handle.
FMOD_ERR_INVALID_THREAD
Tried to call a function on a thread that is not supported.
FMOD_ERR_INVALID_VECTOR
The vectors passed in are not unit length, or perpendicular.
FMOD_ERR_MAXAUDIBLE
Reached maximum audible playback count for this sound's soundgroup.
FMOD_ERR_MEMORY
Not enough memory or resources.
FMOD_ERR_MEMORY_CANTPOINT
Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used.
FMOD_ERR_NEEDS3D
Tried to call a command on a 2d sound when the command was meant for 3d sound.
FMOD_ERR_NEEDSHARDWARE
Tried to use a feature that requires hardware support.
FMOD_ERR_NET_CONNECT
Couldn't connect to the specified host.
FMOD_ERR_NET_SOCKET_ERROR
A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere.
FMOD_ERR_NET_URL
The specified URL couldn't be resolved.
FMOD_ERR_NET_WOULD_BLOCK
Operation on a non-blocking socket could not complete immediately.
FMOD_ERR_NOTREADY
Operation could not be performed because specified sound/DSP connection is not ready.
FMOD_ERR_OUTPUT_ALLOCATED
Error initializing output device, but more specifically, the output device is already in use and cannot be reused.
FMOD_ERR_OUTPUT_CREATEBUFFER
Error creating hardware sound buffer.
FMOD_ERR_OUTPUT_DRIVERCALL
A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted.
FMOD_ERR_OUTPUT_FORMAT
Soundcard does not support the specified format.
FMOD_ERR_OUTPUT_INIT
Error initializing output device.
FMOD_ERR_OUTPUT_NODRIVERS
The output device has no drivers installed. If pre-init, FMOD_OUTPUT_NOSOUND is selected as the output mode. If post-init, the function just fails.
FMOD_ERR_PLUGIN
An unspecified error has been returned from a plugin.
FMOD_ERR_PLUGIN_MISSING
A requested output, dsp unit type or codec was not available.
FMOD_ERR_PLUGIN_RESOURCE
A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback)
FMOD_ERR_PLUGIN_VERSION
A plugin was built with an unsupported SDK version.
FMOD_ERR_RECORD
An error occurred trying to initialize the recording device.
FMOD_ERR_REVERB_CHANNELGROUP
Reverb properties cannot be set on this channel because a parent ChannelGroup owns the reverb connection.
FMOD_ERR_REVERB_INSTANCE
Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesn't exist.
FMOD_ERR_SUBSOUNDS
The error occurred because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound.
FMOD_ERR_SUBSOUND_ALLOCATED
This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first.
FMOD_ERR_SUBSOUND_CANTMOVE
Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file.
FMOD_ERR_TAGNOTFOUND
The specified tag could not be found or there are no tags.
FMOD_ERR_TOOMANYCHANNELS
The sound created exceeds the allowable input channel count. This can be increased using the 'maxinputchannels' parameter in System::setSoftwareFormat.
FMOD_ERR_TRUNCATED
The retrieved string is too long to fit in the supplied buffer and has been truncated.
FMOD_ERR_UNIMPLEMENTED
Something in FMOD hasn't been implemented when it should be! contact support!
FMOD_ERR_UNINITIALIZED
This command failed because System::init or System::setDriver was not called.
FMOD_ERR_UNSUPPORTED
A command issued was not supported by this object. Possibly a plugin without certain callbacks specified.
FMOD_ERR_VERSION
The version number of this file format is not supported.
FMOD_ERR_EVENT_ALREADY_LOADED
The specified bank has already been loaded.
FMOD_ERR_EVENT_LIVEUPDATE_BUSY
The live update connection failed due to the game already being connected.
FMOD_ERR_EVENT_LIVEUPDATE_MISMATCH
The live update connection failed due to the game data being out of sync with the tool.
FMOD_ERR_EVENT_LIVEUPDATE_TIMEOUT
The live update connection timed out.
FMOD_ERR_EVENT_NOTFOUND
The requested event, parameter, bus or vca could not be found.
FMOD_ERR_STUDIO_UNINITIALIZED
The Studio::System object is not yet initialized.
FMOD_ERR_STUDIO_NOT_LOADED
The specified resource is not loaded, so it can't be unloaded.
FMOD_ERR_INVALID_STRING
An invalid string was passed to this function.
FMOD_ERR_ALREADY_LOCKED
The specified resource is already locked.
FMOD_ERR_NOT_LOCKED
The specified resource is not locked, so it can't be unlocked.
FMOD_ERR_RECORD_DISCONNECTED
The specified recording driver has been disconnected.
FMOD_ERR_TOOMANYSAMPLES
The length provided exceeds the allowable limit.

FMOD_SPEAKER

Assigns an enumeration for a speaker index.

C
C++
C#
JS

typedef enum FMOD_SPEAKER {
  FMOD_SPEAKER_NONE = -1,
  FMOD_SPEAKER_FRONT_LEFT,
  FMOD_SPEAKER_FRONT_RIGHT,
  FMOD_SPEAKER_FRONT_CENTER,
  FMOD_SPEAKER_LOW_FREQUENCY,
  FMOD_SPEAKER_SURROUND_LEFT,
  FMOD_SPEAKER_SURROUND_RIGHT,
  FMOD_SPEAKER_BACK_LEFT,
  FMOD_SPEAKER_BACK_RIGHT,
  FMOD_SPEAKER_TOP_FRONT_LEFT,
  FMOD_SPEAKER_TOP_FRONT_RIGHT,
  FMOD_SPEAKER_TOP_BACK_LEFT,
  FMOD_SPEAKER_TOP_BACK_RIGHT,
  FMOD_SPEAKER_MAX
} FMOD_SPEAKER;
FMOD_SPEAKER_NONE
No speaker
FMOD_SPEAKER_FRONT_LEFT
The front left speaker
FMOD_SPEAKER_FRONT_RIGHT
The front right speaker
FMOD_SPEAKER_FRONT_CENTER
The front center speaker
FMOD_SPEAKER_LOW_FREQUENCY
The LFE or 'subwoofer' speaker
FMOD_SPEAKER_SURROUND_LEFT
The surround left (usually to the side) speaker
FMOD_SPEAKER_SURROUND_RIGHT
The surround right (usually to the side) speaker
FMOD_SPEAKER_BACK_LEFT
The back left speaker
FMOD_SPEAKER_BACK_RIGHT
The back right speaker
FMOD_SPEAKER_TOP_FRONT_LEFT
The top front left speaker
FMOD_SPEAKER_TOP_FRONT_RIGHT
The top front right speaker
FMOD_SPEAKER_TOP_BACK_LEFT
The top back left speaker
FMOD_SPEAKER_TOP_BACK_RIGHT
The top back right speaker
FMOD_SPEAKER_MAX
Maximum number of speaker types supported.

See Also: System::setSpeakerPosition, System::getSpeakerPosition

FMOD_SPEAKERMODE

Speaker mode types.

C
C++
C#
JS

typedef enum FMOD_SPEAKERMODE {
  FMOD_SPEAKERMODE_DEFAULT,
  FMOD_SPEAKERMODE_RAW,
  FMOD_SPEAKERMODE_MONO,
  FMOD_SPEAKERMODE_STEREO,
  FMOD_SPEAKERMODE_QUAD,
  FMOD_SPEAKERMODE_SURROUND,
  FMOD_SPEAKERMODE_5POINT1,
  FMOD_SPEAKERMODE_7POINT1,
  FMOD_SPEAKERMODE_7POINT1POINT4,
  FMOD_SPEAKERMODE_MAX
} FMOD_SPEAKERMODE;
FMOD_SPEAKERMODE_DEFAULT
Default speaker mode for the chosen output mode which will resolve after System::init.
FMOD_SPEAKERMODE_RAW
Assume there is no special mapping from a given channel to a speaker, channels map 1:1 in order. Use System::setSoftwareFormat to specify the speaker count.
FMOD_SPEAKERMODE_MONO
1 speaker setup (monaural).
FMOD_SPEAKERMODE_STEREO
2 speaker setup (stereo) front left, front right.
FMOD_SPEAKERMODE_QUAD
4 speaker setup (4.0) front left, front right, surround left, surround right.
FMOD_SPEAKERMODE_SURROUND
5 speaker setup (5.0) front left, front right, center, surround left, surround right.
FMOD_SPEAKERMODE_5POINT1
6 speaker setup (5.1) front left, front right, center, low frequency, surround left, surround right.
FMOD_SPEAKERMODE_7POINT1
8 speaker setup (7.1) front left, front right, center, low frequency, surround left, surround right, back left, back right.
FMOD_SPEAKERMODE_7POINT1POINT4
12 speaker setup (7.1.4) front left, front right, center, low frequency, surround left, surround right, back left, back right, top front left, top front right, top back left, top back right.
FMOD_SPEAKERMODE_MAX
Maximum number of speaker modes supported.

Note below the phrase 'sound channels' is used. These are the subchannels inside a sound, they are not related and have nothing to do with the FMOD class "Channel".

For example a mono sound has 1 sound channel, a stereo sound has 2 sound channels, and an AC3 or 6 channel wav file have 6 "sound channels".

FMOD_SPEAKERMODE_RAW
This mode is for output devices that are not specifically mono/stereo/quad/surround/5.1 or 7.1, but are multichannel.

  • Use System::setSoftwareFormat to specify the number of speakers you want to address, otherwise it will default to 2 (stereo).
  • Sound channels map to speakers sequentially, so a mono sound maps to output speaker 0, stereo sound maps to output speaker 0 & 1.
  • The user assumes knowledge of the speaker order. FMOD_SPEAKER enumerations may not apply, so raw channel indices should be used.
  • Multichannel sounds map input channels to output channels 1:1.
  • Speaker levels must be manually set with Channel::setMixMatrix.
  • Channel::setPan and Channel::setMixLevelsOutput do not work.

FMOD_SPEAKERMODE_MONO
This mode is for a 1 speaker arrangement.

  • Panning does not work in this speaker mode.
  • Mono, stereo and multichannel sounds have each sound channel played on the one speaker at unity.
  • Mix behavior for multichannel sounds can be set with Channel::setMixMatrix.

FMOD_SPEAKERMODE_STEREO
This mode is for 2 speaker arrangements that have a left and right speaker.

  • Mono sounds default to an even distribution between left and right. They can be panned with Channel::setPan.
  • Stereo sounds default to the middle, or full left in the left speaker and full right in the right speaker. They can be cross faded with Channel::setPan.
  • Multichannel sounds have each sound channel played on each speaker at unity.
  • Mix behavior for multichannel sounds can be set with Channel::setMixMatrix.

FMOD_SPEAKERMODE_QUAD
This mode is for 4 speaker arrangements that have a front left, front right, surround left and a surround right speaker.

  • Mono sounds default to an even distribution between front left and front right. They can be panned with Channel::setPan.
  • Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right. They can be cross faded with Channel::setPan.
  • Multichannel sounds default to all of their sound channels being played on each speaker in order of input.
  • Mix behavior for multichannel sounds can be set with Channel::setMixMatrix.

FMOD_SPEAKERMODE_SURROUND
This mode is for 5 speaker arrangements that have a left/right/center/surround left/surround right.

  • Mono sounds default to the center speaker. They can be panned with Channel::setPan.
  • Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right. They can be cross faded with Channel::setPan.
  • Multichannel sounds default to all of their sound channels being played on each speaker in order of input.
  • Mix behavior for multichannel sounds can be set with Channel::setMixMatrix.

FMOD_SPEAKERMODE_5POINT1
This mode is for 5.1 speaker arrangements that have a left/right/center/surround left/surround right and a subwoofer speaker.

  • Mono sounds default to the center speaker. They can be panned with Channel::setPan.
  • Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right. They can be cross faded with Channel::setPan.
  • Multichannel sounds default to all of their sound channels being played on each speaker in order of input.
  • Mix behavior for multichannel sounds can be set with Channel::setMixMatrix.

FMOD_SPEAKERMODE_7POINT1
This mode is for 7.1 speaker arrangements that have a left/right/center/surround left/surround right/rear left/rear right and a subwoofer speaker.

  • Mono sounds default to the center speaker. They can be panned with Channel::setPan.
  • Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right. They can be cross faded with Channel::setPan.
  • Multichannel sounds default to all of their sound channels being played on each speaker in order of input.
  • Mix behavior for multichannel sounds can be set with Channel::setMixMatrix.

See Also: System::getSoftwareFormat, DSP::setChannelFormat

FMOD_SYNCPOINT

Named marker for a given point in time.

C
C++
C#
JS

typedef struct FMOD_SYNCPOINT FMOD_SYNCPOINT;

This is an opaque type that you fetch with Sound::getSyncPoint then query with Sound::getSyncPointInfo.

See Also: Sound::addSyncPoint, Sound::deleteSyncPoint

FMOD_TIMEUNIT

Time types used for position or length.

C
C++
C#
JS

#define FMOD_TIMEUNIT_MS            0x00000001
#define FMOD_TIMEUNIT_PCM           0x00000002
#define FMOD_TIMEUNIT_PCMBYTES      0x00000004
#define FMOD_TIMEUNIT_RAWBYTES      0x00000008
#define FMOD_TIMEUNIT_PCMFRACTION   0x00000010
#define FMOD_TIMEUNIT_MODORDER      0x00000100
#define FMOD_TIMEUNIT_MODROW        0x00000200
#define FMOD_TIMEUNIT_MODPATTERN    0x00000400
FMOD_TIMEUNIT_MS
Milliseconds.
FMOD_TIMEUNIT_PCM
PCM samples, related to milliseconds * samplerate / 1000.
FMOD_TIMEUNIT_PCMBYTES
Bytes, related to PCM samples * channels * datawidth (ie 16bit = 2 bytes).
FMOD_TIMEUNIT_RAWBYTES
Raw file bytes of (compressed) sound data (does not include headers). Only used by Sound::getLength and Channel::getPosition.
FMOD_TIMEUNIT_PCMFRACTION
Fractions of 1 PCM sample. Unsigned int range 0 to 0xFFFFFFFF. Used for sub-sample granularity for DSP purposes.
FMOD_TIMEUNIT_MODORDER
MOD/S3M/XM/IT. Order in a sequenced module format. Use Sound::getFormat to determine the PCM format being decoded to.
FMOD_TIMEUNIT_MODROW
MOD/S3M/XM/IT. Current row in a sequenced module format. Cannot use with Channel::setPosition. Sound::getLength will return the number of rows in the currently playing or seeked to pattern.
FMOD_TIMEUNIT_MODPATTERN
MOD/S3M/XM/IT. Current pattern in a sequenced module format. Cannot use with Channel::setPosition. Sound::getLength will return the number of patterns in the song and Channel::getPosition will return the currently playing pattern.

See Also: Sound::getLength, Channel::setPosition, Channel::getPosition

FMOD_VECTOR

Structure describing a point in 3D space.

C
C++
C#
JS

typedef struct FMOD_VECTOR {
  float   x;
  float   y;
  float   z;
} FMOD_VECTOR;
x
X coordinate in 3D space.
y
Y coordinate in 3D space.
z
Z coordinate in 3D space.

FMOD uses a left handed coordinate system by default.

To use a right handed coordinate system specify FMOD_INIT_3D_RIGHTHANDED from FMOD_INITFLAGS in System::init.

See Also: System::set3DListenerAttributes, ChannelControl::set3DAttributes

FMOD_VERSION

Current FMOD version number.

C
C++
C#
JS

#define FMOD_VERSION ...
FMOD_VERSION
Current FMOD version 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.

See Also: Studio::System::create, System::getVersion