FMOD Engine User Manual 2.03
File:
Memory:
Debugging:
Threading:
General:
Structure describing a position, velocity and orientation.
typedef struct FMOD_3D_ATTRIBUTES {
FMOD_VECTOR position;
FMOD_VECTOR velocity;
FMOD_VECTOR forward;
FMOD_VECTOR up;
} FMOD_3D_ATTRIBUTES;
struct ATTRIBUTES_3D
{
VECTOR position;
VECTOR velocity;
VECTOR forward;
VECTOR up;
}
_3D_ATTRIBUTES
{
position,
velocity,
forward,
up,
};
Position in world space used for panning and attenuation. (FMOD_VECTOR)
Velocity in world space used for doppler. (FMOD_VECTOR)
up
. (FMOD_VECTOR)forward
. (FMOD_VECTOR)Vectors must be provided in the correct handedness.
See Also: FMOD_DSP_PARAMETER_3DATTRIBUTES
Flags that describe the speakers present in a given signal.
#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)
[Flags]
enum CHANNELMASK : uint
{
FRONT_LEFT = 0x00000001,
FRONT_RIGHT = 0x00000002,
FRONT_CENTER = 0x00000004,
LOW_FREQUENCY = 0x00000008,
SURROUND_LEFT = 0x00000010,
SURROUND_RIGHT = 0x00000020,
BACK_LEFT = 0x00000040,
BACK_RIGHT = 0x00000080,
BACK_CENTER = 0x00000100,
MONO = (FRONT_LEFT),
STEREO = (FRONT_LEFT | FRONT_RIGHT),
LRC = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER),
QUAD = (FRONT_LEFT | FRONT_RIGHT | SURROUND_LEFT | SURROUND_RIGHT),
SURROUND = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT),
_5POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT),
_5POINT1_REARS = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT),
_7POINT0 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT),
_7POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT)
}
CHANNELMASK_FRONT_LEFT = 0x00000001
CHANNELMASK_FRONT_RIGHT = 0x00000002
CHANNELMASK_FRONT_CENTER = 0x00000004
CHANNELMASK_LOW_FREQUENCY = 0x00000008
CHANNELMASK_SURROUND_LEFT = 0x00000010
CHANNELMASK_SURROUND_RIGHT = 0x00000020
CHANNELMASK_BACK_LEFT = 0x00000040
CHANNELMASK_BACK_RIGHT = 0x00000080
CHANNELMASK_BACK_CENTER = 0x00000100
CHANNELMASK_MONO = (CHANNELMASK_FRONT_LEFT))
CHANNELMASK_STEREO = (CHANNELMASK_FRONT_LEFT | CHANNELMASK_FRONT_RIGHT))
CHANNELMASK_LRC = (CHANNELMASK_FRONT_LEFT | CHANNELMASK_FRONT_RIGHT | CHANNELMASK_FRONT_CENTER))
CHANNELMASK_QUAD = (CHANNELMASK_FRONT_LEFT | CHANNELMASK_FRONT_RIGHT | CHANNELMASK_SURROUND_LEFT | CHANNELMASK_SURROUND_RIGHT))
CHANNELMASK_SURROUND = (CHANNELMASK_FRONT_LEFT | CHANNELMASK_FRONT_RIGHT | CHANNELMASK_FRONT_CENTER | CHANNELMASK_SURROUND_LEFT | CHANNELMASK_SURROUND_RIGHT))
CHANNELMASK_5POINT1 = (CHANNELMASK_FRONT_LEFT | CHANNELMASK_FRONT_RIGHT | CHANNELMASK_FRONT_CENTER | CHANNELMASK_LOW_FREQUENCY | CHANNELMASK_SURROUND_LEFT | CHANNELMASK_SURROUND_RIGHT))
CHANNELMASK_5POINT1_REARS = (CHANNELMASK_FRONT_LEFT | CHANNELMASK_FRONT_RIGHT | CHANNELMASK_FRONT_CENTER | CHANNELMASK_LOW_FREQUENCY | CHANNELMASK_BACK_LEFT | CHANNELMASK_BACK_RIGHT))
CHANNELMASK_7POINT0 = (CHANNELMASK_FRONT_LEFT | CHANNELMASK_FRONT_RIGHT | CHANNELMASK_FRONT_CENTER | CHANNELMASK_SURROUND_LEFT | CHANNELMASK_SURROUND_RIGHT | CHANNELMASK_BACK_LEFT | CHANNELMASK_BACK_RIGHT))
CHANNELMASK_7POINT1 = (CHANNELMASK_FRONT_LEFT | CHANNELMASK_FRONT_RIGHT | CHANNELMASK_FRONT_CENTER | CHANNELMASK_LOW_FREQUENCY | CHANNELMASK_SURROUND_LEFT | CHANNELMASK_SURROUND_RIGHT | CHANNELMASK_BACK_LEFT | CHANNELMASK_BACK_RIGHT))
See Also: DSP::setChannelFormat, DSP::getChannelFormat
Speaker ordering for multi-channel signals.
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;
enum CHANNELORDER : int
{
DEFAULT,
WAVEFORMAT,
PROTOOLS,
ALLMONO,
ALLSTEREO,
ALSA,
MAX,
}
CHANNELORDER_DEFAULT
CHANNELORDER_WAVEFORMAT
CHANNELORDER_PROTOOLS
CHANNELORDER_ALLMONO
CHANNELORDER_ALLSTEREO
CHANNELORDER_ALSA
CHANNELORDER_MAX
See Also: FMOD_CREATESOUNDEXINFO
Performance information for Core API functionality.
typedef struct FMOD_CPU_USAGE {
float dsp;
float stream;
float geometry;
float update;
float convolution1;
float convolution2;
} FMOD_CPU_USAGE;
struct CPU_USAGE
{
float dsp;
float stream;
float geometry;
float update;
float convolution1;
float convolution2;
}
CPU_USAGE
{
dsp,
stream,
geometry,
update,
convolution1,
convolution2
};
DSP mixing engine CPU usage. Percentage of FMOD_THREAD_TYPE_MIXER, or main thread if FMOD_INIT_MIX_FROM_UPDATE flag is used with System::init.
Streaming engine CPU usage. Percentage of FMOD_THREAD_TYPE_STREAM, or main thread if FMOD_INIT_STREAM_FROM_UPDATE flag is used with System::init.
Geometry engine CPU usage. Percentage of FMOD_THREAD_TYPE_GEOMETRY.
System::update CPU usage. Percentage of main thread.
Convolution reverb processing thread #1 CPU usage. Percentage of FMOD_THREAD_TYPE_CONVOLUTION1.
Convolution reverb processing thread #2 CPU usage. Percentage of FMOD_THREAD_TYPE_CONVOLUTION2.
This structure is filled in with System::getCPUUsage.
For readability, the percentage values are smoothed to provide a more stable output.
'Percentage of main thread' in the descriptions above refers to the thread that the function is called from by the user.
The use of FMOD_THREAD_TYPE_CONVOLUTION1 or FMOD_THREAD_TYPE_CONVOLUTION2 can be controlled with FMOD_ADVANCEDSETTINGS::maxConvolutionThreads.
See Also: Studio::System::getCPUUsage, FMOD_STUDIO_CPU_USAGE
Callback for debug messages when using the logging version of FMOD.
FMOD_RESULT F_CALL FMOD_DEBUG_CALLBACK(
FMOD_DEBUG_FLAGS flags,
const char *file,
int line,
const char *func,
const char *message
);
delegate RESULT DEBUG_CALLBACK(
DEBUG_FLAGS flags,
IntPtr file,
int line,
IntPtr func,
IntPtr message
);
Not supported for JavaScript.
The 'file', 'func', and 'message' arguments can be used via StringWrapper
by using FMOD.StringWrapper string = new FMOD.StringWrapper(ptrToString);
This callback will fire directly from the log line, as such it can be from any thread.
See Also: Debug_Initialize
Specify the requested information to be output when using the logging version of FMOD.
#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
[Flags]
enum DEBUG_FLAGS : uint
{
NONE = 0x00000000,
ERROR = 0x00000001,
WARNING = 0x00000002,
LOG = 0x00000004,
TYPE_MEMORY = 0x00000100,
TYPE_FILE = 0x00000200,
TYPE_CODEC = 0x00000400,
TYPE_TRACE = 0x00000800,
DISPLAY_TIMESTAMPS = 0x00010000,
DISPLAY_LINENUMBERS = 0x00020000,
DISPLAY_THREAD = 0x00040000,
}
DEBUG_LEVEL_NONE = 0x00000000
DEBUG_LEVEL_ERROR = 0x00000001
DEBUG_LEVEL_WARNING = 0x00000002
DEBUG_LEVEL_LOG = 0x00000004
DEBUG_TYPE_MEMORY = 0x00000100
DEBUG_TYPE_FILE = 0x00000200
DEBUG_TYPE_CODEC = 0x00000400
DEBUG_TYPE_TRACE = 0x00000800
DEBUG_DISPLAY_TIMESTAMPS = 0x00010000
DEBUG_DISPLAY_LINENUMBERS = 0x00020000
DEBUG_DISPLAY_THREAD = 0x00040000
See Also: Debug_Initialize
Specify the level and delivery method of log messages when using the logging version of FMOD.
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
);
FMOD_RESULT FMOD_Debug_Initialize(
FMOD_DEBUG_FLAGS flags,
FMOD_DEBUG_MODE mode,
FMOD_DEBUG_CALLBACK callback,
const char *filename
);
static RESULT Debug.Initialize(
DEBUG_FLAGS flags,
DEBUG_MODE mode = DEBUG_MODE.TTY,
DEBUG_CALLBACK callback = null,
string filename = null
);
Debug_Initialize(
flags
);
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
Specify the destination of log output when using the logging version of FMOD.
typedef enum FMOD_DEBUG_MODE {
FMOD_DEBUG_MODE_TTY,
FMOD_DEBUG_MODE_FILE,
FMOD_DEBUG_MODE_CALLBACK
} FMOD_DEBUG_MODE;
enum DEBUG_MODE : int
{
TTY,
FILE,
CALLBACK,
}
Not supported for JavaScript.
TTY destination can vary depending on platform, common examples include the Visual Studio / Xcode output window, stderr and LogCat.
See Also: Debug_Initialize
Information function to retrieve the state of FMOD disk access.
FMOD_RESULT File_GetDiskBusy(
int *busy
);
FMOD_RESULT FMOD_File_GetDiskBusy(
int *busy
);
Not supported for C#.
Not supported for JavaScript.
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 calling this function, internally FMOD might set it to busy. Use File_SetDiskBusy for proper mutual exclusion as it uses semaphores.
See Also: File_SetDiskBusy
Sets the busy state for disk access ensuring mutual exclusion of file operations.
FMOD_RESULT File_SetDiskBusy(
int busy
);
FMOD_RESULT FMOD_File_SetDiskBusy(
int busy
);
Not supported for C#.
Not supported for JavaScript.
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
Structure describing a globally unique identifier.
typedef struct FMOD_GUID {
unsigned int Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} FMOD_GUID;
struct System.Guid
FMOD_GUID
{
Data1,
Data2,
Data3,
Data4,
};
See Also: System::getDriverInfo
Maximum number of channels per sample of audio supported by audio files, buffers, connections and DSPs.
#define FMOD_MAX_CHANNEL_WIDTH 32
class CONSTANTS
{
const int MAX_CHANNEL_WIDTH = 32;
}
MAX_CHANNEL_WIDTH = 32
See Also: System::setSoftwareFormat, ChannelControl::setMixMatrix, DSP::setChannelFormat
Maximum number of listeners supported.
#define FMOD_MAX_LISTENERS 8
class CONSTANTS
{
const int MAX_LISTENERS = 8;
}
MAX_LISTENERS = 8
See Also: System::set3DNumListeners, System::set3DListenerAttributes
Maximum number of System objects allowed.
#define FMOD_MAX_SYSTEMS 8
class CONSTANTS
{
const int MAX_SYSTEMS = 8;
}
Not supported for JavaScript.
See Also: System_Create
Callback to allocate a block of memory.
void * F_CALL FMOD_MEMORY_ALLOC_CALLBACK(
unsigned int size,
FMOD_MEMORY_TYPE type,
const char *sourcestr
);
delegate IntPtr MEMORY_ALLOC_CALLBACK(
uint size,
MEMORY_TYPE type,
IntPtr sourcestr
);
Not supported for JavaScript.
Size of the memory block to be allocated and returned.
Returning an aligned pointer, of 16 byte alignment is recommended for performance reasons.
The 'sourcestr' argument can be used via StringWrapper
by using FMOD.StringWrapper sourceStr = new FMOD.StringWrapper(sourcestr);
See Also: Memory_Initialize, Memory_GetStats, FMOD_MEMORY_REALLOC_CALLBACK, FMOD_MEMORY_FREE_CALLBACK
Callback to free a block of memory.
void F_CALL FMOD_MEMORY_FREE_CALLBACK(
void *ptr,
FMOD_MEMORY_TYPE type,
const char *sourcestr
);
delegate void MEMORY_FREE_CALLBACK(
IntPtr ptr,
MEMORY_TYPE type,
IntPtr sourcestr
);
Not supported for JavaScript.
The 'sourcestr' argument can be used via StringWrapper
by using FMOD.StringWrapper sourceStr = new FMOD.StringWrapper(sourcestr);
See Also: Memory_Initialize, FMOD_MEMORY_ALLOC_CALLBACK, FMOD_MEMORY_REALLOC_CALLBACK
Returns information on the memory usage of FMOD.
FMOD_RESULT Memory_GetStats(
int *currentalloced,
int *maxalloced,
bool blocking = true
);
FMOD_RESULT FMOD_Memory_GetStats(
int *currentalloced,
int *maxalloced,
FMOD_BOOL blocking
);
static RESULT Memory.GetStats(
out int currentalloced,
out int maxalloced,
bool blocking = true
);
Memory_GetStats(
currentalloced,
maxalloced,
blocking
);
Flag to indicate whether to favour speed or accuracy. Specifying true for this parameter will flush the DSP graph to make sure all queued allocations happen immediately, which can be costly.
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.
Specifies a method for FMOD to allocate and free memory, either through user supplied callbacks or through a user supplied memory buffer with a fixed size.
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
);
FMOD_RESULT FMOD_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
);
static RESULT Memory.Initialize(
IntPtr poolmem,
int poollen,
MEMORY_ALLOC_CALLBACK useralloc,
MEMORY_REALLOC_CALLBACK userrealloc,
MEMORY_FREE_CALLBACK userfree,
MEMORY_TYPE memtypeflags = MEMORY_TYPE.ALL
);
Not supported for JavaScript.
poollen
bytes for FMOD to manage, mutually exclusive with useralloc
/ userrealloc
/ userfree
.Size of poolmem
, must be a multiple of 512.
poolmem
. (FMOD_MEMORY_ALLOC_CALLBACK)poolmem
. (FMOD_MEMORY_REALLOC_CALLBACK)poolmem
. (FMOD_MEMORY_FREE_CALLBACK)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.
If 'useralloc' and 'userfree' are provided without 'userrealloc' the reallocation is implemented via an allocation of the new size, copy from old address to new, then a free of the old address.
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
Callback to re-allocate a block of memory to a different size.
void * F_CALL FMOD_MEMORY_REALLOC_CALLBACK(
void *ptr,
unsigned int size,
FMOD_MEMORY_TYPE type,
const char *sourcestr
);
delegate IntPtr MEMORY_REALLOC_CALLBACK(
IntPtr ptr,
uint size,
MEMORY_TYPE type,
IntPtr sourcestr
);
Not supported for JavaScript.
Size of the memory to be reallocated.
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.
The 'sourcestr' argument can be used via StringWrapper
by using FMOD.StringWrapper sourceStr = new FMOD.StringWrapper(sourcestr);
See Also: Memory_Initialize, Memory_GetStats, FMOD_MEMORY_ALLOC_CALLBACK, FMOD_MEMORY_FREE_CALLBACK
Bitfields for memory allocation type being passed into FMOD memory callbacks.
#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
[Flags]
enum MEMORY_TYPE : uint
{
NORMAL = 0x00000000,
STREAM_FILE = 0x00000001,
STREAM_DECODE = 0x00000002,
SAMPLEDATA = 0x00000004,
DSP_BUFFER = 0x00000008,
PLUGIN = 0x00000010,
PERSISTENT = 0x00200000,
ALL = 0xFFFFFFFF
}
Not supported for JavaScript.
See Also: FMOD_MEMORY_ALLOC_CALLBACK, FMOD_MEMORY_REALLOC_CALLBACK, FMOD_MEMORY_FREE_CALLBACK, Memory_Initialize
Sound description bitfields, bitwise OR them together for loading and describing Sounds.
#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
[Flags]
enum MODE : uint
{
DEFAULT = 0x00000000,
LOOP_OFF = 0x00000001,
LOOP_NORMAL = 0x00000002,
LOOP_BIDI = 0x00000004,
_2D = 0x00000008,
_3D = 0x00000010,
CREATESTREAM = 0x00000080,
CREATESAMPLE = 0x00000100,
CREATECOMPRESSEDSAMPLE = 0x00000200,
OPENUSER = 0x00000400,
OPENMEMORY = 0x00000800,
OPENMEMORY_POINT = 0x10000000,
OPENRAW = 0x00001000,
OPENONLY = 0x00002000,
ACCURATETIME = 0x00004000,
MPEGSEARCH = 0x00008000,
NONBLOCKING = 0x00010000,
UNIQUE = 0x00020000,
_3D_HEADRELATIVE = 0x00040000,
_3D_WORLDRELATIVE = 0x00080000,
_3D_INVERSEROLLOFF = 0x00100000,
_3D_LINEARROLLOFF = 0x00200000,
_3D_LINEARSQUAREROLLOFF = 0x00400000,
_3D_INVERSETAPEREDROLLOFF = 0x00800000,
_3D_CUSTOMROLLOFF = 0x04000000,
_3D_IGNOREGEOMETRY = 0x40000000,
IGNORETAGS = 0x02000000,
LOWMEM = 0x08000000,
VIRTUAL_PLAYFROMSTART = 0x80000000
}
DEFAULT = 0x00000000
LOOP_OFF = 0x00000001
LOOP_NORMAL = 0x00000002
LOOP_BIDI = 0x00000004
_2D = 0x00000008
_3D = 0x00000010
CREATESTREAM = 0x00000080
CREATESAMPLE = 0x00000100
CREATECOMPRESSEDSAMPLE = 0x00000200
OPENUSER = 0x00000400
OPENMEMORY = 0x00000800
OPENMEMORY_POINT = 0x10000000
OPENRAW = 0x00001000
OPENONLY = 0x00002000
ACCURATETIME = 0x00004000
MPEGSEARCH = 0x00008000
NONBLOCKING = 0x00010000
UNIQUE = 0x00020000
_3D_HEADRELATIVE = 0x00040000
_3D_WORLDRELATIVE = 0x00080000
_3D_INVERSEROLLOFF = 0x00100000
_3D_LINEARROLLOFF = 0x00200000
_3D_LINEARSQUAREROLLOFF = 0x00400000
_3D_INVERSETAPEREDROLLOFF = 0x00800000
_3D_CUSTOMROLLOFF = 0x04000000
_3D_IGNOREGEOMETRY = 0x40000000
IGNORETAGS = 0x02000000
LOWMEM = 0x08000000
VIRTUAL_PLAYFROMSTART = 0x80000000
name_or_data
, is ignored, so recommended practice is to pass null or equivalent. The following data must be provided using FMOD_CREATESOUNDEXINFO: cbsize
, length
, numchannels
, defaultfrequency
, format
, and optionally readcallback
. If a user-created 'sample' is created with no read callback, the sample will be empty. If this is the case, use Sound::lock and Sound::unlock to place sound data into the Sound. name_or_data
, is interpreted as a pointer to memory instead of filename for creating sounds. The following data must be provided using FMOD_CREATESOUNDEXINFO: cbsize
, and 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.name_or_data
, is interpreted as a pointer to memory instead of filename for creating sounds. The following data must be provided using FMOD_CREATESOUNDEXINFO: cbsize
, and 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.cbsize
, numchannels
, defaultfrequency
, and format
. Must be little endian data.mindistance
, the volume is unattenuated; as distance
increases above mindistance
, the volume attenuates using mindistance/distance
as the gradient until it reaches maxdistance
, where it stops attenuating. For this roll-off mode, distance values greater than mindistance
are scaled according to the rolloffscale. This roll-off mode accurately models the way sounds attenuate over distance in the real world. (DEFAULT)mindistance
, the volume is unattenuated; as distance
increases from mindistance
to maxdistance
, the volume attenuates to silence using a linear gradient. For this roll-off mode, distance values greater than mindistance
are scaled according to the rolloffscale. While this roll-off mode is not as realistic as inverse roll-off mode, it is easier to comprehend.mindistance
, the volume is unattenuated; as distance
increases from mindistance
to maxdistance
, the volume attenuates to silence according to a linear squared gradient. For this roll-off mode, distance
values greater than mindistance
are scaled according to the rolloffscale. This roll-off mode provides steeper volume ramping close to the mindistance
, and more gradual ramping close to the maxdistance
, than linear roll-off mode.mindistance
are scaled according to the rolloffscale. Inverse tapered roll-off mode approximates realistic behavior while still guaranteeing the sound attenuates to silence at maxdistance
.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 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
Error codes returned from every function.
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;
enum RESULT : int
{
OK,
ERR_BADCOMMAND,
ERR_CHANNEL_ALLOC,
ERR_CHANNEL_STOLEN,
ERR_DMA,
ERR_DSP_CONNECTION,
ERR_DSP_DONTPROCESS,
ERR_DSP_FORMAT,
ERR_DSP_INUSE,
ERR_DSP_NOTFOUND,
ERR_DSP_RESERVED,
ERR_DSP_SILENCE,
ERR_DSP_TYPE,
ERR_FILE_BAD,
ERR_FILE_COULDNOTSEEK,
ERR_FILE_DISKEJECTED,
ERR_FILE_EOF,
ERR_FILE_ENDOFDATA,
ERR_FILE_NOTFOUND,
ERR_FORMAT,
ERR_HEADER_MISMATCH,
ERR_HTTP,
ERR_HTTP_ACCESS,
ERR_HTTP_PROXY_AUTH,
ERR_HTTP_SERVER_ERROR,
ERR_HTTP_TIMEOUT,
ERR_INITIALIZATION,
ERR_INITIALIZED,
ERR_INTERNAL,
ERR_INVALID_FLOAT,
ERR_INVALID_HANDLE,
ERR_INVALID_PARAM,
ERR_INVALID_POSITION,
ERR_INVALID_SPEAKER,
ERR_INVALID_SYNCPOINT,
ERR_INVALID_THREAD,
ERR_INVALID_VECTOR,
ERR_MAXAUDIBLE,
ERR_MEMORY,
ERR_MEMORY_CANTPOINT,
ERR_NEEDS3D,
ERR_NEEDSHARDWARE,
ERR_NET_CONNECT,
ERR_NET_SOCKET_ERROR,
ERR_NET_URL,
ERR_NET_WOULD_BLOCK,
ERR_NOTREADY,
ERR_OUTPUT_ALLOCATED,
ERR_OUTPUT_CREATEBUFFER,
ERR_OUTPUT_DRIVERCALL,
ERR_OUTPUT_FORMAT,
ERR_OUTPUT_INIT,
ERR_OUTPUT_NODRIVERS,
ERR_PLUGIN,
ERR_PLUGIN_MISSING,
ERR_PLUGIN_RESOURCE,
ERR_PLUGIN_VERSION,
ERR_RECORD,
ERR_REVERB_CHANNELGROUP,
ERR_REVERB_INSTANCE,
ERR_SUBSOUNDS,
ERR_SUBSOUND_ALLOCATED,
ERR_SUBSOUND_CANTMOVE,
ERR_TAGNOTFOUND,
ERR_TOOMANYCHANNELS,
ERR_TRUNCATED,
ERR_UNIMPLEMENTED,
ERR_UNINITIALIZED,
ERR_UNSUPPORTED,
ERR_VERSION,
ERR_EVENT_ALREADY_LOADED,
ERR_EVENT_LIVEUPDATE_BUSY,
ERR_EVENT_LIVEUPDATE_MISMATCH,
ERR_EVENT_LIVEUPDATE_TIMEOUT,
ERR_EVENT_NOTFOUND,
ERR_STUDIO_UNINITIALIZED,
ERR_STUDIO_NOT_LOADED,
ERR_INVALID_STRING,
ERR_ALREADY_LOCKED,
ERR_NOT_LOCKED,
ERR_RECORD_DISCONNECTED,
ERR_TOOMANYSAMPLES,
}
OK
ERR_BADCOMMAND
ERR_CHANNEL_ALLOC
ERR_CHANNEL_STOLEN
ERR_DMA
ERR_DSP_CONNECTION
ERR_DSP_DONTPROCESS
ERR_DSP_FORMAT
ERR_DSP_INUSE
ERR_DSP_NOTFOUND
ERR_DSP_RESERVED
ERR_DSP_SILENCE
ERR_DSP_TYPE
ERR_FILE_BAD
ERR_FILE_COULDNOTSEEK
ERR_FILE_DISKEJECTED
ERR_FILE_EOF
ERR_FILE_ENDOFDATA
ERR_FILE_NOTFOUND
ERR_FORMAT
ERR_HEADER_MISMATCH
ERR_HTTP
ERR_HTTP_ACCESS
ERR_HTTP_PROXY_AUTH
ERR_HTTP_SERVER_ERROR
ERR_HTTP_TIMEOUT
ERR_INITIALIZATION
ERR_INITIALIZED
ERR_INTERNAL
ERR_INVALID_FLOAT
ERR_INVALID_HANDLE
ERR_INVALID_PARAM
ERR_INVALID_POSITION
ERR_INVALID_SPEAKER
ERR_INVALID_SYNCPOINT
ERR_INVALID_THREAD
ERR_INVALID_VECTOR
ERR_MAXAUDIBLE
ERR_MEMORY
ERR_MEMORY_CANTPOINT
ERR_NEEDS3D
ERR_NEEDSHARDWARE
ERR_NET_CONNECT
ERR_NET_SOCKET_ERROR
ERR_NET_URL
ERR_NET_WOULD_BLOCK
ERR_NOTREADY
ERR_OUTPUT_ALLOCATED
ERR_OUTPUT_CREATEBUFFER
ERR_OUTPUT_DRIVERCALL
ERR_OUTPUT_FORMAT
ERR_OUTPUT_INIT
ERR_OUTPUT_NODRIVERS
ERR_PLUGIN
ERR_PLUGIN_MISSING
ERR_PLUGIN_RESOURCE
ERR_PLUGIN_VERSION
ERR_RECORD
ERR_REVERB_CHANNELGROUP
ERR_REVERB_INSTANCE
ERR_SUBSOUNDS
ERR_SUBSOUND_ALLOCATED
ERR_SUBSOUND_CANTMOVE
ERR_TAGNOTFOUND
ERR_TOOMANYCHANNELS
ERR_TRUNCATED
ERR_UNIMPLEMENTED
ERR_UNINITIALIZED
ERR_UNSUPPORTED
ERR_VERSION
ERR_EVENT_ALREADY_LOADED
ERR_EVENT_LIVEUPDATE_BUSY
ERR_EVENT_LIVEUPDATE_MISMATCH
ERR_EVENT_LIVEUPDATE_TIMEOUT
ERR_EVENT_NOTFOUND
ERR_STUDIO_UNINITIALIZED
ERR_STUDIO_NOT_LOADED
ERR_INVALID_STRING
ERR_ALREADY_LOCKED
ERR_NOT_LOCKED
ERR_RECORD_DISCONNECTED
ERR_TOOMANYSAMPLES
Assigns an enumeration for a speaker index.
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;
enum SPEAKER : int
{
NONE = -1,
FRONT_LEFT,
FRONT_RIGHT,
FRONT_CENTER,
LOW_FREQUENCY,
SURROUND_LEFT,
SURROUND_RIGHT,
BACK_LEFT,
BACK_RIGHT,
TOP_FRONT_LEFT,
TOP_FRONT_RIGHT,
TOP_BACK_LEFT,
TOP_BACK_RIGHT,
MAX,
}
SPEAKER_NONE = -1
SPEAKER_FRONT_LEFT
SPEAKER_FRONT_RIGHT
SPEAKER_FRONT_CENTER
SPEAKER_LOW_FREQUENCY
SPEAKER_SURROUND_LEFT
SPEAKER_SURROUND_RIGHT
SPEAKER_BACK_LEFT
SPEAKER_BACK_RIGHT
SPEAKER_TOP_FRONT_LEFT
SPEAKER_TOP_FRONT_RIGHT
SPEAKER_TOP_BACK_LEFT
SPEAKER_TOP_BACK_RIGHT
SPEAKER_MAX
See Also: System::setSpeakerPosition, System::getSpeakerPosition
Speaker mode types.
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;
enum SPEAKERMODE : int
{
DEFAULT,
RAW,
MONO,
STEREO,
QUAD,
SURROUND,
_5POINT1,
_7POINT1,
_7POINT1POINT4,
MAX,
}
SPEAKERMODE_DEFAULT
SPEAKERMODE_RAW
SPEAKERMODE_MONO
SPEAKERMODE_STEREO
SPEAKERMODE_QUAD
SPEAKERMODE_SURROUND
SPEAKERMODE_5POINT1
SPEAKERMODE_7POINT1
SPEAKERMODE_7POINT1POINT4
SPEAKERMODE_MAX
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 multi-channel.
FMOD_SPEAKERMODE_MONO
This mode is for a 1 speaker arrangement.
FMOD_SPEAKERMODE_STEREO
This mode is for 2 speaker arrangements that have a left and right speaker.
FMOD_SPEAKERMODE_QUAD
This mode is for 4 speaker arrangements that have a front left, front right, surround left and a surround right speaker.
FMOD_SPEAKERMODE_SURROUND
This mode is for 5 speaker arrangements that have a left/right/center/surround left/surround right.
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.
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.
See the FMOD Studio Mixing Guide for graphical depictions of each speaker mode.
See Also: System::getSoftwareFormat, DSP::setChannelFormat
Named marker for a given point in time.
typedef struct FMOD_SYNCPOINT FMOD_SYNCPOINT;
IntPtr
Not supported for JavaScript.
This is an opaque type that you fetch with Sound::getSyncPoint then query with Sound::getSyncPointInfo.
See Also: Sound::addSyncPoint, Sound::deleteSyncPoint
Bitfield for specifying the CPU core a given thread runs on.
#define FMOD_THREAD_AFFINITY_GROUP_DEFAULT 0x4000000000000000
#define FMOD_THREAD_AFFINITY_GROUP_A 0x4000000000000001
#define FMOD_THREAD_AFFINITY_GROUP_B 0x4000000000000002
#define FMOD_THREAD_AFFINITY_GROUP_C 0x4000000000000003
#define FMOD_THREAD_AFFINITY_MIXER FMOD_THREAD_AFFINITY_GROUP_A
#define FMOD_THREAD_AFFINITY_FEEDER FMOD_THREAD_AFFINITY_GROUP_C
#define FMOD_THREAD_AFFINITY_STREAM FMOD_THREAD_AFFINITY_GROUP_C
#define FMOD_THREAD_AFFINITY_FILE FMOD_THREAD_AFFINITY_GROUP_C
#define FMOD_THREAD_AFFINITY_NONBLOCKING FMOD_THREAD_AFFINITY_GROUP_C
#define FMOD_THREAD_AFFINITY_RECORD FMOD_THREAD_AFFINITY_GROUP_C
#define FMOD_THREAD_AFFINITY_GEOMETRY FMOD_THREAD_AFFINITY_GROUP_C
#define FMOD_THREAD_AFFINITY_PROFILER FMOD_THREAD_AFFINITY_GROUP_C
#define FMOD_THREAD_AFFINITY_STUDIO_UPDATE FMOD_THREAD_AFFINITY_GROUP_B
#define FMOD_THREAD_AFFINITY_STUDIO_LOAD_BANK FMOD_THREAD_AFFINITY_GROUP_C
#define FMOD_THREAD_AFFINITY_STUDIO_LOAD_SAMPLE FMOD_THREAD_AFFINITY_GROUP_C
#define FMOD_THREAD_AFFINITY_CORE_ALL 0
#define FMOD_THREAD_AFFINITY_CORE_0 (1 << 0)
#define FMOD_THREAD_AFFINITY_CORE_1 (1 << 1)
#define FMOD_THREAD_AFFINITY_CORE_2 (1 << 2)
#define FMOD_THREAD_AFFINITY_CORE_3 (1 << 3)
#define FMOD_THREAD_AFFINITY_CORE_4 (1 << 4)
#define FMOD_THREAD_AFFINITY_CORE_5 (1 << 5)
#define FMOD_THREAD_AFFINITY_CORE_6 (1 << 6)
#define FMOD_THREAD_AFFINITY_CORE_7 (1 << 7)
#define FMOD_THREAD_AFFINITY_CORE_8 (1 << 8)
#define FMOD_THREAD_AFFINITY_CORE_9 (1 << 9)
#define FMOD_THREAD_AFFINITY_CORE_10 (1 << 10)
#define FMOD_THREAD_AFFINITY_CORE_11 (1 << 11)
#define FMOD_THREAD_AFFINITY_CORE_12 (1 << 12)
#define FMOD_THREAD_AFFINITY_CORE_13 (1 << 13)
#define FMOD_THREAD_AFFINITY_CORE_14 (1 << 14)
#define FMOD_THREAD_AFFINITY_CORE_15 (1 << 15)
[Flags]
enum THREAD_AFFINITY : long
{
GROUP_DEFAULT = 0x4000000000000000,
GROUP_A = 0x4000000000000001,
GROUP_B = 0x4000000000000002,
GROUP_C = 0x4000000000000003,
MIXER = GROUP_A,
FEEDER = GROUP_C,
STREAM = GROUP_C,
FILE = GROUP_C,
NONBLOCKING = GROUP_C,
RECORD = GROUP_C,
GEOMETRY = GROUP_C,
PROFILER = GROUP_C,
STUDIO_UPDATE = GROUP_B,
STUDIO_LOAD_BANK = GROUP_C,
STUDIO_LOAD_SAMPLE = GROUP_C,
CORE_ALL = 0,
CORE_0 = 1 << 0,
CORE_1 = 1 << 1,
CORE_2 = 1 << 2,
CORE_3 = 1 << 3,
CORE_4 = 1 << 4,
CORE_5 = 1 << 5,
CORE_6 = 1 << 6,
CORE_7 = 1 << 7,
CORE_8 = 1 << 8,
CORE_9 = 1 << 9,
CORE_10 = 1 << 10,
CORE_11 = 1 << 11,
CORE_12 = 1 << 12,
CORE_13 = 1 << 13,
CORE_14 = 1 << 14,
CORE_15 = 1 << 15
}
Not supported for JavaScript.
The platform agnostic thread groups, A, B and C give recommendations about FMOD threads that should be separated from one another.
Platforms with fixed CPU core counts will try to honor this request, those that don't will leave affinity to the operating system.
See the FMOD platform specific docs for each platform to see how the groups map to cores.
If an explicit core affinity is given, i.e. FMOD_THREAD_AFFINITY_CORE_11 and that core is unavailable a fatal error will be produced.
Explicit core assignment up to (1 << 61)
is supported for platforms with that many cores.
See Also: Thread_SetAttributes
Scheduling priority to assign a given thread to.
#define FMOD_THREAD_PRIORITY_PLATFORM_MIN (-32 * 1024)
#define FMOD_THREAD_PRIORITY_PLATFORM_MAX ( 32 * 1024)
#define FMOD_THREAD_PRIORITY_DEFAULT (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 1)
#define FMOD_THREAD_PRIORITY_LOW (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 2)
#define FMOD_THREAD_PRIORITY_MEDIUM (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 3)
#define FMOD_THREAD_PRIORITY_HIGH (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 4)
#define FMOD_THREAD_PRIORITY_VERY_HIGH (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 5)
#define FMOD_THREAD_PRIORITY_EXTREME (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 6)
#define FMOD_THREAD_PRIORITY_CRITICAL (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 7)
#define FMOD_THREAD_PRIORITY_MIXER FMOD_THREAD_PRIORITY_EXTREME
#define FMOD_THREAD_PRIORITY_FEEDER FMOD_THREAD_PRIORITY_CRITICAL
#define FMOD_THREAD_PRIORITY_STREAM FMOD_THREAD_PRIORITY_VERY_HIGH
#define FMOD_THREAD_PRIORITY_FILE FMOD_THREAD_PRIORITY_HIGH
#define FMOD_THREAD_PRIORITY_NONBLOCKING FMOD_THREAD_PRIORITY_HIGH
#define FMOD_THREAD_PRIORITY_RECORD FMOD_THREAD_PRIORITY_HIGH
#define FMOD_THREAD_PRIORITY_GEOMETRY FMOD_THREAD_PRIORITY_LOW
#define FMOD_THREAD_PRIORITY_PROFILER FMOD_THREAD_PRIORITY_MEDIUM
#define FMOD_THREAD_PRIORITY_STUDIO_UPDATE FMOD_THREAD_PRIORITY_MEDIUM
#define FMOD_THREAD_PRIORITY_STUDIO_LOAD_BANK FMOD_THREAD_PRIORITY_MEDIUM
#define FMOD_THREAD_PRIORITY_STUDIO_LOAD_SAMPLE FMOD_THREAD_PRIORITY_MEDIUM
enum THREAD_PRIORITY : int
{
PLATFORM_MIN = -32 * 1024,
PLATFORM_MAX = 32 * 1024,
DEFAULT = PLATFORM_MIN - 1,
LOW = PLATFORM_MIN - 2,
MEDIUM = PLATFORM_MIN - 3,
HIGH = PLATFORM_MIN - 4,
VERY_HIGH = PLATFORM_MIN - 5,
EXTREME = PLATFORM_MIN - 6,
CRITICAL = PLATFORM_MIN - 7,
MIXER = EXTREME,
FEEDER = CRITICAL,
STREAM = VERY_HIGH,
FILE = HIGH,
NONBLOCKING = HIGH,
RECORD = HIGH,
GEOMETRY = LOW,
PROFILER = MEDIUM,
STUDIO_UPDATE = MEDIUM,
STUDIO_LOAD_BANK = MEDIUM,
STUDIO_LOAD_SAMPLE = MEDIUM
}
Not supported for JavaScript.
The platform agnostic priorities are used to rank FMOD threads against one another for best runtime scheduling.
Platforms will translate these values in to platform specific priorities.
See the FMOD platform specific docs for each platform to see how the agnostic priorities map to specific values.
Explicit platform specific priorities can be given within the range of FMOD_THREAD_PRIORITY_PLATFORM_MIN to FMOD_THREAD_PRIORITY_PLATFORM_MAX.
See platform documentation for details on the available priority values for a given operating system.
See Also: Thread_SetAttributes
Specify the affinity, priority and stack size for all FMOD created threads.
FMOD_RESULT Thread_SetAttributes(
FMOD_THREAD_TYPE type,
FMOD_THREAD_AFFINITY affinity = FMOD_THREAD_AFFINITY_GROUP_DEFAULT,
FMOD_THREAD_PRIORITY priority = FMOD_THREAD_PRIORITY_DEFAULT,
FMOD_THREAD_STACK_SIZE stacksize = FMOD_THREAD_STACK_SIZE_DEFAULT
);
FMOD_RESULT FMOD_Thread_SetAttributes(
FMOD_THREAD_TYPE type,
FMOD_THREAD_AFFINITY affinity,
FMOD_THREAD_PRIORITY priority,
FMOD_THREAD_STACK_SIZE stacksize
);
static RESULT Thread.SetAttributes(
THREAD_TYPE type,
THREAD_AFFINITY affinity = THREAD_AFFINITY.GROUP_DEFAULT,
THREAD_PRIORITY priority = THREAD_PRIORITY.DEFAULT,
THREAD_STACK_SIZE stacksize = THREAD_STACK_SIZE.DEFAULT
);
Not supported for JavaScript.
You must call this function for the chosen thread before that thread is created for the settings to take effect.
Affinity can be specified using one (or more) of the FMOD_THREAD_AFFINITY constants or by providing the bits explicitly, i.e. (1<<3) for logical core three (core affinity is zero based).
See platform documentation for details on the available cores for a given device.
Priority can be specified using one of the FMOD_THREAD_PRIORITY constants or by providing the value explicitly, i.e. (-2) for the lowest thread priority on Windows.
See platform documentation for details on the available priority values for a given operating system.
Stack size can be specified explicitly, however for each thread you should provide a size equal to or larger than the expected default or risk causing a stack overflow at runtime.
Stack space available to the given thread.
#define FMOD_THREAD_STACK_SIZE_DEFAULT 0
#define FMOD_THREAD_STACK_SIZE_MIXER (80 * 1024)
#define FMOD_THREAD_STACK_SIZE_FEEDER (16 * 1024)
#define FMOD_THREAD_STACK_SIZE_STREAM (96 * 1024)
#define FMOD_THREAD_STACK_SIZE_FILE (64 * 1024)
#define FMOD_THREAD_STACK_SIZE_NONBLOCKING (112 * 1024)
#define FMOD_THREAD_STACK_SIZE_RECORD (16 * 1024)
#define FMOD_THREAD_STACK_SIZE_GEOMETRY (48 * 1024)
#define FMOD_THREAD_STACK_SIZE_PROFILER (128 * 1024)
#define FMOD_THREAD_STACK_SIZE_STUDIO_UPDATE (96 * 1024)
#define FMOD_THREAD_STACK_SIZE_STUDIO_LOAD_BANK (96 * 1024)
#define FMOD_THREAD_STACK_SIZE_STUDIO_LOAD_SAMPLE (96 * 1024)
enum THREAD_STACK_SIZE : uint
{
DEFAULT = 0,
MIXER = 80 * 1024,
FEEDER = 16 * 1024,
STREAM = 96 * 1024,
FILE = 64 * 1024,
NONBLOCKING = 112 * 1024,
RECORD = 16 * 1024,
GEOMETRY = 48 * 1024,
PROFILER = 128 * 1024,
STUDIO_UPDATE = 96 * 1024,
STUDIO_LOAD_BANK = 96 * 1024,
STUDIO_LOAD_SAMPLE = 96 * 1024
}
Not supported for JavaScript.
Stack size can be specified explicitly, however for each thread you should provide a size equal to or larger than the expected default or risk causing a stack overflow at runtime.
See Also: Thread_SetAttributes
Named constants for threads created at runtime.
typedef enum FMOD_THREAD_TYPE {
FMOD_THREAD_TYPE_MIXER,
FMOD_THREAD_TYPE_FEEDER,
FMOD_THREAD_TYPE_STREAM,
FMOD_THREAD_TYPE_FILE,
FMOD_THREAD_TYPE_NONBLOCKING,
FMOD_THREAD_TYPE_RECORD,
FMOD_THREAD_TYPE_GEOMETRY,
FMOD_THREAD_TYPE_PROFILER,
FMOD_THREAD_TYPE_STUDIO_UPDATE,
FMOD_THREAD_TYPE_STUDIO_LOAD_BANK,
FMOD_THREAD_TYPE_STUDIO_LOAD_SAMPLE,
FMOD_THREAD_TYPE_CONVOLUTION1,
FMOD_THREAD_TYPE_CONVOLUTION2,
FMOD_THREAD_TYPE_MAX
} FMOD_THREAD_TYPE;
enum THREAD_TYPE : int
{
MIXER,
FEEDER,
STREAM,
FILE,
NONBLOCKING,
RECORD,
GEOMETRY,
PROFILER,
STUDIO_UPDATE,
STUDIO_LOAD_BANK,
STUDIO_LOAD_SAMPLE,
CONVOLUTION1,
CONVOLUTION2,
MAX
}
Not supported for JavaScript.
See Also: Thread_SetAttributes
Time types used for position or length.
#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
[Flags]
enum TIMEUNIT : uint
{
MS = 0x00000001,
PCM = 0x00000002,
PCMBYTES = 0x00000004,
RAWBYTES = 0x00000008,
PCMFRACTION = 0x00000010,
MODORDER = 0x00000100,
MODROW = 0x00000200,
MODPATTERN = 0x00000400,
}
TIMEUNIT_MS = 0x00000001
TIMEUNIT_PCM = 0x00000002
TIMEUNIT_PCMBYTES = 0x00000004
TIMEUNIT_RAWBYTES = 0x00000008
TIMEUNIT_PCMFRACTION = 0x00000010
TIMEUNIT_MODORDER = 0x00000100
TIMEUNIT_MODROW = 0x00000200
TIMEUNIT_MODPATTERN = 0x00000400
See Also: Sound::getLength, Channel::setPosition, Channel::getPosition
Structure describing a point in 3D space.
typedef struct FMOD_VECTOR {
float x;
float y;
float z;
} FMOD_VECTOR;
struct VECTOR
{
float x;
float y;
float z;
}
FMOD_VECTOR
{
x,
y,
z,
};
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
Current FMOD version number.
#define FMOD_VERSION ...
class VERSION
{
const int number = ...;
}
Not supported for JavaScript.
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