FMOD Engine User Manual 2.03
An instance of an FMOD Studio event.
Playback Control:
Playback Properties:
3D Attributes:
Parameters:
Core:
Profiling:
Callbacks:
General:
Retrieves the 3D attributes.
FMOD_RESULT Studio::EventInstance::get3DAttributes(
FMOD_3D_ATTRIBUTES *attributes
);
FMOD_RESULT FMOD_Studio_EventInstance_Get3DAttributes(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_3D_ATTRIBUTES *attributes
);
RESULT Studio.EventInstance.get3DAttributes(
out _3D_ATTRIBUTES attributes
);
Studio.EventInstance.get3DAttributes(
attributes
);
See Also: Studio::EventInstance::set3DAttributes
Retrieves the core ChannelGroup.
FMOD_RESULT Studio::EventInstance::getChannelGroup(
ChannelGroup **group
);
FMOD_RESULT FMOD_Studio_EventInstance_GetChannelGroup(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_CHANNELGROUP **group
);
RESULT Studio.EventInstance.getChannelGroup(
out FMOD.ChannelGroup group
);
Studio.EventInstance.getChannelGroup(
group
);
Until the event instance has been fully created this function will return FMOD_ERR_STUDIO_NOT_LOADED.
Retrieves the event CPU usage data.
FMOD_RESULT Studio::EventInstance::getCPUUsage(
unsigned int *exclusive,
unsigned int *inclusive
);
FMOD_RESULT FMOD_Studio_EventInstance_GetCPUUsage(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
unsigned int *exclusive,
unsigned int *inclusive
);
RESULT Studio.EventInstance.getCPUUsage(
out uint exclusive,
out uint inclusive
);
Studio.EventInstance.getCPUUsage(
exclusive,
inclusive
);
CPU time spent processing just this unit during the last update.
CPU time spent processing this unit and all of its input during the last update.
FMOD_INIT_PROFILE_ENABLE with System::init is required to call this function.
Retrieves the event description.
FMOD_RESULT Studio::EventInstance::getDescription(
Studio::EventDescription **description
);
FMOD_RESULT FMOD_Studio_EventInstance_GetDescription(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_EVENTDESCRIPTION **description
);
RESULT Studio.EventInstance.getDescription(
out EventDescription description
);
Studio.EventInstance.getDescription(
description
);
Retrieves the listener mask.
FMOD_RESULT Studio::EventInstance::getListenerMask(
unsigned int *mask
);
FMOD_RESULT FMOD_Studio_EventInstance_GetListenerMask(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
unsigned int *mask
);
RESULT Studio.EventInstance.getListenerMask(
out uint mask
);
Studio.EventInstance.getListenerMask(
mask
);
See Also: Studio::EventInstance::setListenerMask
Retrieves memory usage statistics.
FMOD_RESULT Studio::EventInstance::getMemoryUsage(
FMOD_STUDIO_MEMORY_USAGE *memoryusage
);
FMOD_RESULT FMOD_Studio_EventInstance_GetMemoryUsage(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_MEMORY_USAGE *memoryusage
);
RESULT Studio.EventInstance.getMemoryUsage(
out MEMORY_USAGE memoryusage
);
Not supported for JavaScript.
Memory usage statistics are only available in logging builds, in release builds memoryusage
will contain zero for all values this function.
Retrieves the minimum and maximum distances for 3D attenuation.
FMOD_RESULT Studio::EventInstance::getMinMaxDistance(
float *min,
float *max
);
FMOD_RESULT FMOD_Studio_EventInstance_GetMinMaxDistance(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
float *min,
float *max
);
RESULT Studio.EventInstance.getMinMaxDistance(
out float min,
out float max
);
Studio.EventInstance.getMinMaxDistance(
min,
max
);
Minimum distance.
Maximum distance.
See Also: Studio::EventDescription::getMinMaxDistance
Retrieves a parameter value by unique identifier.
FMOD_RESULT Studio::EventInstance::getParameterByID(
FMOD_STUDIO_PARAMETER_ID id,
float *value,
float *finalvalue = nullptr
);
FMOD_RESULT FMOD_Studio_EventInstance_GetParameterByID(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_PARAMETER_ID id,
float *value,
float *finalvalue
);
RESULT Studio.EventInstance.getParameterByID(
PARAMETER_ID id,
out float value
);
RESULT Studio.EventInstance.getParameterByID(
PARAMETER_ID id,
out float value,
out float finalvalue
);
Studio.EventInstance.getParameterByID(
id,
value,
finalvalue
);
Automatic parameters always return value
as 0 since they can never have their value set from the public API.
finalvalue
is the final value of the parameter after applying adjustments due to automation, modulation, seek speed, and parameter velocity to value
. This is calculated asynchronously when the Studio system updates.
See Also: Studio::EventInstance::setParameterByID
Retrieves a parameter value by name, including the path if needed.
FMOD_RESULT Studio::EventInstance::getParameterByName(
const char *name,
float *value,
float *finalvalue = nullptr
);
FMOD_RESULT FMOD_Studio_EventInstance_GetParameterByName(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
const char *name,
float *value,
float *finalvalue
);
RESULT Studio.EventInstance.getParameterByName(
string name,
out float value
);
RESULT Studio.EventInstance.getParameterByName(
string name,
out float value,
out float finalvalue
);
Studio.EventInstance.getParameterByName(
name,
value,
finalvalue
);
Automatic parameters always return value
as 0 since they can never have their value set from the public API.
finalvalue
is the final value of the parameter after applying adjustments due to automation, modulation, seek speed, and parameter velocity to value
. This is calculated asynchronously when the Studio system updates.
See Also: Studio::EventInstance::setParameterByName
Retrieves the pause state.
FMOD_RESULT Studio::EventInstance::getPaused(
bool *paused
);
FMOD_RESULT FMOD_Studio_EventInstance_GetPaused(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_BOOL *paused
);
RESULT Studio.EventInstance.getPaused(
out bool paused
);
Studio.EventInstance.getPaused(
paused
);
Pause state. True if the event instance is paused.
See Also: Studio::EventInstance::setPaused
Retrieves the pitch multiplier.
FMOD_RESULT Studio::EventInstance::getPitch(
float *pitch,
float *finalpitch = nullptr
);
FMOD_RESULT FMOD_Studio_EventInstance_GetPitch(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
float *pitch,
float *finalpitch
);
RESULT Studio.EventInstance.getPitch(
out float pitch
);
RESULT Studio.EventInstance.getPitch(
out float pitch,
out float finalpitch
);
Studio.EventInstance.getPitch(
pitch,
finalpitch
);
The final combined value returned in finalpitch
combines the pitch set using Studio::EventInstance::setPitch with the result of any automation or modulation. The final combined pitch is calculated asynchronously when the Studio system updates.
Retrieves the playback state.
FMOD_RESULT Studio::EventInstance::getPlaybackState(
FMOD_STUDIO_PLAYBACK_STATE *state
);
FMOD_RESULT FMOD_Studio_EventInstance_GetPlaybackState(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_PLAYBACK_STATE *state
);
RESULT Studio.EventInstance.getPlaybackState(
out PLAYBACK_STATE state
);
Studio.EventInstance.getPlaybackState(
state
);
You can poll this function to track the playback state of an event instance.
If the instance is invalid, then the state will be set to FMOD_STUDIO_PLAYBACK_STOPPED.
See Also: Studio::EventInstance::start, Studio::EventInstance::stop, FMOD_STUDIO_EVENT_CALLBACK_TYPE
Retrieves the value of a built-in property.
FMOD_RESULT Studio::EventInstance::getProperty(
FMOD_STUDIO_EVENT_PROPERTY index,
float *value
);
FMOD_RESULT FMOD_Studio_EventInstance_GetProperty(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_EVENT_PROPERTY index,
float *value
);
RESULT Studio.EventInstance.getProperty(
EVENT_PROPERTY index,
out float value
);
Studio.EventInstance.getProperty(
index,
value
);
A default FMOD_STUDIO_EVENT_PROPERTY value means that the Instance is using the value set in Studio and it has not been overridden using Studio::EventInstance::setProperty. Access the default property values through the Studio::EventDescription.
Retrieves the core reverb send level.
FMOD_RESULT Studio::EventInstance::getReverbLevel(
int index,
float *level
);
FMOD_RESULT FMOD_Studio_EventInstance_GetReverbLevel(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
int index,
float *level
);
RESULT Studio.EventInstance.getReverbLevel(
int index,
out float level
);
Studio.EventInstance.getReverbLevel(
index,
level
);
Core reverb instance index.
See Also: Studio::EventInstance::setReverbLevel
Retrieves the FMOD Studio System.
FMOD_RESULT Studio::EventInstance::getSystem(
Studio::System **system
);
FMOD_RESULT FMOD_Studio_EventInstance_GetSystem(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_SYSTEM **system
);
RESULT Studio.EventInstance.getSystem(
out System system
);
Studio.EventInstance.getSystem(
system
);
Retrieves the timeline cursor position.
FMOD_RESULT Studio::EventInstance::getTimelinePosition(
int *position
);
FMOD_RESULT FMOD_Studio_EventInstance_GetTimelinePosition(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
int *position
);
RESULT Studio.EventInstance.getTimelinePosition(
out int position
);
Studio.EventInstance.getTimelinePosition(
position
);
See Also: Studio::EventInstance::setTimelinePosition
Retrieves the event instance user data.
FMOD_RESULT Studio::EventInstance::getUserData(
void **userdata
);
FMOD_RESULT FMOD_Studio_EventInstance_GetUserData(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
void **userdata
);
RESULT Studio.EventInstance.getUserData(
out IntPtr userdata
);
Studio.EventInstance.getUserData(
userdata
);
This function allows arbitrary user data to be retrieved from this object. See the User Data section of the glossary for an example of how to get and set user data.
Retrieves the volume level.
FMOD_RESULT Studio::EventInstance::getVolume(
float *volume,
float *finalvolume = nullptr
);
FMOD_RESULT FMOD_Studio_EventInstance_GetVolume(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
float *volume,
float *finalvolume
);
RESULT Studio.EventInstance.getVolume(
out float volume
);
RESULT Studio.EventInstance.getVolume(
out float volume,
out float finalvolume
);
Studio.EventInstance.getVolume(
volume,
finalvolume
);
The final combined value returned in finalvolume
combines the volume set using the public API with the result of any automation or modulation. The final combined volume is calculated asynchronously when the Studio system updates.
See Also: Studio::EventInstance::setVolume
Checks that the EventInstance reference is valid.
bool Studio::EventInstance::isValid()
bool FMOD_Studio_EventInstance_IsValid(FMOD_STUDIO_EVENTINSTANCE *eventinstance)
bool Studio.EventInstance.isValid()
Studio.EventInstance.isValid()
Retrieves the virtualization state.
FMOD_RESULT Studio::EventInstance::isVirtual(
bool *virtualstate
);
FMOD_RESULT FMOD_Studio_EventInstance_IsVirtual(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_BOOL *virtualstate
);
RESULT Studio.EventInstance.isVirtual(
out bool virtualstate
);
Studio.EventInstance.isVirtual(
virtualstate
);
Virtualization state. True if the event instance has been virtualized.
This function checks whether an event instance has been virtualized due to the polyphony limit being exceeded. See the Virtual Voice guide for more information.
Allow an event to continue past a sustain point.
FMOD_RESULT Studio::EventInstance::keyOff();
FMOD_RESULT FMOD_Studio_EventInstance_KeyOff(FMOD_STUDIO_EVENTINSTANCE *eventinstance);
RESULT Studio.EventInstance.keyOff();
Studio.EventInstance.keyOff();
Multiple sustain points may be bypassed ahead of time and the key off count will be decremented each time the timeline cursor passes a sustain point.
This function returns FMOD_ERR_EVENT_NOTFOUND if the event has no sustain points.
See Also: Studio::EventDescription::hasSustainPoint
Marks the event instance for release.
FMOD_RESULT Studio::EventInstance::release();
FMOD_RESULT FMOD_Studio_EventInstance_Release(FMOD_STUDIO_EVENTINSTANCE *eventinstance);
RESULT Studio.EventInstance.release();
Studio.EventInstance.release();
This function marks the event instance to be released. Event instances marked for release are destroyed by the asynchronous update when they are in the stopped state (FMOD_STUDIO_PLAYBACK_STOPPED).
Generally it is a best practice to release event instances immediately after calling Studio::EventInstance::start, unless you want to play the event instance multiple times or explicitly stop it and start it again later. It is possible to interact with the instance after falling release()
, however if the sound has stopped ERR_INVALID_HANDLE
will be returned.
See Also: Studio::EventInstance::stop, Studio::EventInstance::getPlaybackState
Sets the 3D attributes.
FMOD_RESULT Studio::EventInstance::set3DAttributes(
const FMOD_3D_ATTRIBUTES *attributes
);
FMOD_RESULT FMOD_Studio_EventInstance_Set3DAttributes(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_3D_ATTRIBUTES *attributes
);
RESULT Studio.EventInstance.set3DAttributes(
_3D_ATTRIBUTES attributes
);
Studio.EventInstance.set3DAttributes(
attributes
);
An event's 3D attributes specify its position, velocity and orientation. The 3D attributes are used to calculate 3D panning, doppler and the values of automatic distance and angle parameters.
See Also: Studio::EventInstance::get3DAttributes
Sets the user callback.
FMOD_RESULT Studio::EventInstance::setCallback(
FMOD_STUDIO_EVENT_CALLBACK callback,
FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask = FMOD_STUDIO_EVENT_CALLBACK_ALL
);
FMOD_RESULT FMOD_Studio_EventInstance_SetCallback(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_EVENT_CALLBACK callback,
FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask
);
RESULT Studio.EventInstance.setCallback(
EVENT_CALLBACK callback,
EVENT_CALLBACK_TYPE callbackmask = EVENT_CALLBACK_TYPE.ALL
);
Studio.EventInstance.setCallback(
callback,
callbackmask
);
See Event Callbacks for more information about when callbacks occur.
See Also: Callback Behavior, Studio::EventDescription::setCallback
Sets the listener mask.
FMOD_RESULT Studio::EventInstance::setListenerMask(
unsigned int mask
);
FMOD_RESULT FMOD_Studio_EventInstance_SetListenerMask(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
unsigned int mask
);
RESULT Studio.EventInstance.setListenerMask(
uint mask
);
Studio.EventInstance.setListenerMask(
mask
);
Listener mask.
The listener mask controls which listeners are considered when calculating 3D panning and the values of listener relative automatic parameters.
To create the mask you must perform bitwise OR and shift operations, the basic form is 1 << listener_index
ORd together with other required listener indices.
For example to create a mask for listener index 0 and 2 the calculation would be mask = (1 << 0) | (1 << 2)
, to include all listeners use the default mask of 0xFFFFFFFF
.
See Also: Studio::EventInstance::getListenerMask
Sets a parameter value by unique identifier.
FMOD_RESULT Studio::EventInstance::setParameterByID(
FMOD_STUDIO_PARAMETER_ID id,
float value,
bool ignoreseekspeed = false
);
FMOD_RESULT FMOD_Studio_EventInstance_SetParameterByID(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_PARAMETER_ID id,
float value,
FMOD_BOOL ignoreseekspeed
);
RESULT Studio.EventInstance.setParameterByID(
PARAMETER_ID id,
float value,
bool ignoreseekspeed = false
);
Studio.EventInstance.setParameterByID(
id,
value,
ignoreseekspeed
);
Specifies whether to ignore the parameter's seek speed and set the value immediately.
The value
will be set instantly regardless of ignoreseekspeed
when the Event playback state is FMOD_STUDIO_PLAYBACK_STOPPED.
If the specified parameter is read only, is an automatic parameter, or is not of type FMOD_STUDIO_PARAMETER_GAME_CONTROLLED, then FMOD_ERR_INVALID_PARAM is returned.
See Also: Studio::EventInstance::setParameterByName, Studio::EventInstance::setParametersByIDs, Studio::EventInstance::getParameterByName, Studio::EventInstance::getParameterByID
Sets a parameter value by unique identifier, looking up the value label.
FMOD_RESULT Studio::EventInstance::setParameterByIDWithLabel(
FMOD_STUDIO_PARAMETER_ID id,
const char *label,
bool ignoreseekspeed = false
);
FMOD_RESULT FMOD_Studio_EventInstance_SetParameterByIDWithLabel(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_PARAMETER_ID id,
const char *label,
FMOD_BOOL ignoreseekspeed
);
RESULT Studio.EventInstance.setParameterByIDWithLabel(
PARAMETER_ID id,
string label,
bool ignoreseekspeed = false
);
Studio.EventInstance.setParameterByIDWithLabel(
id,
label,
ignoreseekspeed
);
The label
will be set instantly regardless of ignoreseekspeed
when the Event playback state is FMOD_STUDIO_PLAYBACK_STOPPED.
If the specified parameter is read only, is an automatic parameter or is not of type FMOD_STUDIO_PARAMETER_GAME_CONTROLLED then FMOD_ERR_INVALID_PARAM is returned.
If the specified label is not found, FMOD_ERR_EVENT_NOTFOUND is returned. This lookup is case sensitive.
See Also: Studio::EventInstance::setParameterByName, Studio::EventInstance::setParametersByIDs, Studio::EventInstance::getParameterByName, Studio::EventInstance::getParameterByID
Sets a parameter value by name, including the path if needed.
FMOD_RESULT Studio::EventInstance::setParameterByName(
const char *name,
float value,
bool ignoreseekspeed = false
);
FMOD_RESULT FMOD_Studio_EventInstance_SetParameterByName(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
const char *name,
float value,
FMOD_BOOL ignoreseekspeed
);
RESULT Studio.EventInstance.setParameterByName(
string name,
float value,
bool ignoreseekspeed = false
);
Studio.EventInstance.setParameterByName(
name,
value,
ignoreseekspeed
);
Specifies whether to ignore the parameter's seek speed and set the value immediately.
The value
will be set instantly regardless of ignoreseekspeed
when the Event playback state is FMOD_STUDIO_PLAYBACK_STOPPED.
If the specified parameter is read only, is an automatic parameter or is not of type FMOD_STUDIO_PARAMETER_GAME_CONTROLLED then FMOD_ERR_INVALID_PARAM is returned.
If the event has no parameter matching name
then FMOD_ERR_EVENT_NOTFOUND is returned.
See Also: Studio::EventInstance::setParameterByID, Studio::EventInstance::setParametersByIDs, Studio::EventInstance::getParameterByName, Studio::EventInstance::getParameterByID
Sets a parameter value by name, including the path if needed, looking up the value label.
FMOD_RESULT Studio::EventInstance::setParameterByNameWithLabel(
const char *name,
const char *label,
bool ignoreseekspeed = false
);
FMOD_RESULT FMOD_Studio_EventInstance_SetParameterByNameWithLabel(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
const char *name,
const char *label,
FMOD_BOOL ignoreseekspeed
);
RESULT Studio.EventInstance.setParameterByNameWithLabel(
string name,
string label,
bool ignoreseekspeed = false
);
Studio.EventInstance.setParameterByNameWithLabel(
name,
label,
ignoreseekspeed
);
The label
will be set instantly regardless of ignoreseekspeed
when the Event playback state is FMOD_STUDIO_PLAYBACK_STOPPED.
If the specified parameter is read only, is an automatic parameter or is not of type FMOD_STUDIO_PARAMETER_GAME_CONTROLLED then FMOD_ERR_INVALID_PARAM is returned.
If the event has no parameter matching name
then FMOD_ERR_EVENT_NOTFOUND is returned.
If the specified label is not found, FMOD_ERR_EVENT_NOTFOUND is returned. This lookup is case sensitive.
See Also: Studio::EventInstance::setParameterByID, Studio::EventInstance::setParametersByIDs, Studio::EventInstance::getParameterByName, Studio::EventInstance::getParameterByID
Sets multiple parameter values by unique identifier.
FMOD_RESULT Studio::EventInstance::setParametersByIDs(
const FMOD_STUDIO_PARAMETER_ID *ids,
float *values,
int count,
bool ignoreseekspeed = false
);
FMOD_RESULT FMOD_Studio_EventInstance_SetParametersByIDs(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
const FMOD_STUDIO_PARAMETER_ID *ids,
float *values,
int count,
FMOD_BOOL ignoreseekspeed
);
RESULT Studio.EventInstance.setParametersByIDs(
PARAMETER_ID[] ids,
float[] values,
int count,
bool ignoreseekspeed = false
);
Studio.EventInstance.setParametersByIDs(
ids,
values,
count,
ignoreseekspeed
);
Number of items in the given arrays.
Specifies whether to ignore the parameter's seek speed and set the value immediately.
All values
will be set instantly regardless of ignoreseekspeed
when the Event playback state is FMOD_STUDIO_PLAYBACK_STOPPED.
If any ID is set to all zeroes then the corresponding value will be ignored.
See Also: Studio::EventInstance::setParameterByName, Studio::EventInstance::setParameterByID, Studio::EventInstance::getParameterByName, Studio::EventInstance::getParameterByID
Sets the pause state.
FMOD_RESULT Studio::EventInstance::setPaused(
bool paused
);
FMOD_RESULT FMOD_Studio_EventInstance_SetPaused(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_BOOL paused
);
RESULT Studio.EventInstance.setPaused(
bool paused
);
Studio.EventInstance.setPaused(
paused
);
The desired pause state. True = paused, False = unpaused.
This function allows pausing/unpausing of an event instance.
See Also: Studio::EventInstance::getPaused
Sets the pitch multiplier.
FMOD_RESULT Studio::EventInstance::setPitch(
float pitch
);
FMOD_RESULT FMOD_Studio_EventInstance_SetPitch(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
float pitch
);
RESULT Studio.EventInstance.setPitch(
float pitch
);
Studio.EventInstance.setPitch(
pitch
);
Pitch multiplier.
The pitch multiplier is used to modulate the event instance's pitch. The pitch multiplier can be set to any value greater than or equal to zero but the final combined pitch is clamped to the range [0, 100] before being applied.
See Also: Studio::EventInstance::getPitch
Sets the value of a built-in property.
FMOD_RESULT Studio::EventInstance::setProperty(
FMOD_STUDIO_EVENT_PROPERTY index,
float value
);
FMOD_RESULT FMOD_Studio_EventInstance_SetProperty(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_EVENT_PROPERTY index,
float value
);
RESULT Studio.EventInstance.setProperty(
EVENT_PROPERTY index,
float value
);
Studio.EventInstance.setProperty(
index,
value
);
This will override the value set in Studio. Using the default FMOD_STUDIO_EVENT_PROPERTY value will revert back to the default values set in Studio.
An FMOD spatializer or object spatializer may override the values set for FMOD_STUDIO_EVENT_PROPERTY_MINIMUM_DISTANCE and FMOD_STUDIO_EVENT_PROPERTY_MAXIMUM_DISTANCE.
See Also: Studio::EventInstance::getProperty
Sets the core reverb send level.
FMOD_RESULT Studio::EventInstance::setReverbLevel(
int index,
float level
);
FMOD_RESULT FMOD_Studio_EventInstance_SetReverbLevel(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
int index,
float level
);
RESULT Studio.EventInstance.setReverbLevel(
int index,
float level
);
Studio.EventInstance.setReverbLevel(
index,
level
);
Core reverb instance index.
Reverb send level.
This function controls the send level for the signal from the event instance to a core reverb instance.
See Also: Studio::EventInstance::getReverbLevel, Working with Reverb
Sets the timeline cursor position.
FMOD_RESULT Studio::EventInstance::setTimelinePosition(
int position
);
FMOD_RESULT FMOD_Studio_EventInstance_SetTimelinePosition(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
int position
);
RESULT Studio.EventInstance.setTimelinePosition(
int position
);
Studio.EventInstance.setTimelinePosition(
position
);
Timeline position.
See Also: Studio::EventInstance::getTimelinePosition
Sets the event instance user data.
FMOD_RESULT Studio::EventInstance::setUserData(
void *userdata
);
FMOD_RESULT FMOD_Studio_EventInstance_SetUserData(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
void *userdata
);
RESULT Studio.EventInstance.setUserData(
IntPtr userdata
);
Studio.EventInstance.setUserData(
userdata
);
This function allows arbitrary user data to be attached to this object. See the User Data section of the glossary for an example of how to get and set user data.
See Also: Studio::EventInstance::getUserData
Sets the volume level.
FMOD_RESULT Studio::EventInstance::setVolume(
float volume
);
FMOD_RESULT FMOD_Studio_EventInstance_SetVolume(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
float volume
);
RESULT Studio.EventInstance.setVolume(
float volume
);
Studio.EventInstance.setVolume(
volume
);
Volume.
This volume is applied as a scaling factor for the event volume. It does not override the volume level set in FMOD Studio, nor any internal volume automation or modulation.
See Also: Studio::EventInstance::getVolume
Starts playback.
FMOD_RESULT Studio::EventInstance::start();
FMOD_RESULT FMOD_Studio_EventInstance_Start(FMOD_STUDIO_EVENTINSTANCE *eventinstance);
RESULT Studio.EventInstance.start();
Studio.EventInstance.start();
If the instance was already playing then calling this function will restart the event.
Generally it is a best practice to call Studio::EventInstance::release on event instances immediately after starting them, unless you want to play the event instance multiple times or explicitly stop it and start it again later.
See Also: Studio::EventInstance::stop, Sample Data Loading
Stops playback.
FMOD_RESULT Studio::EventInstance::stop(
FMOD_STUDIO_STOP_MODE mode
);
FMOD_RESULT FMOD_Studio_EventInstance_Stop(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_STOP_MODE mode
);
RESULT Studio.EventInstance.stop(
STOP_MODE mode
);
Studio.EventInstance.stop(
mode
);
See Also: Studio::EventInstance::start
Callback that is fired when a Studio::EventInstance changes state.
FMOD_RESULT F_CALL FMOD_STUDIO_EVENT_CALLBACK(
FMOD_STUDIO_EVENT_CALLBACK_TYPE type,
FMOD_STUDIO_EVENTINSTANCE *event,
void *parameters
);
delegate RESULT Studio.EVENT_CALLBACK(
EVENT_CALLBACK_TYPE type,
IntPtr event,
IntPtr parameters
);
function FMOD_STUDIO_EVENT_CALLBACK(
type,
event,
parameters
)
The data passed to the callback function in the parameters
argument varies based on the callback type. See FMOD_STUDIO_EVENT_CALLBACK_TYPE for more information.
Return FMOD_OK from the callback unless you wish to signal that there is an error. Select an appropriate error code from FMOD_RESULT. Returning an error will result in a warning or error message being logged.
The 'event' argument Can be cast to Studio::EventInstance *
.
The 'event' argument can be used via EventInstance
by using FMOD.Studio.EventInstance instance = new FMOD.Studio.EventInstance(event);
See Also: Callback Behavior, Studio::EventInstance::setCallback, Studio::EventDescription::setCallback, Studio::System::getSoundInfo, FMOD_STUDIO_EVENT_CALLBACK_TYPE, FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES
Studio event callback types.
#define FMOD_STUDIO_EVENT_CALLBACK_CREATED 0x00000001
#define FMOD_STUDIO_EVENT_CALLBACK_DESTROYED 0x00000002
#define FMOD_STUDIO_EVENT_CALLBACK_STARTING 0x00000004
#define FMOD_STUDIO_EVENT_CALLBACK_STARTED 0x00000008
#define FMOD_STUDIO_EVENT_CALLBACK_RESTARTED 0x00000010
#define FMOD_STUDIO_EVENT_CALLBACK_STOPPED 0x00000020
#define FMOD_STUDIO_EVENT_CALLBACK_START_FAILED 0x00000040
#define FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND 0x00000080
#define FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND 0x00000100
#define FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_CREATED 0x00000200
#define FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_DESTROYED 0x00000400
#define FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER 0x00000800
#define FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT 0x00001000
#define FMOD_STUDIO_EVENT_CALLBACK_SOUND_PLAYED 0x00002000
#define FMOD_STUDIO_EVENT_CALLBACK_SOUND_STOPPED 0x00004000
#define FMOD_STUDIO_EVENT_CALLBACK_REAL_TO_VIRTUAL 0x00008000
#define FMOD_STUDIO_EVENT_CALLBACK_VIRTUAL_TO_REAL 0x00010000
#define FMOD_STUDIO_EVENT_CALLBACK_START_EVENT_COMMAND 0x00020000
#define FMOD_STUDIO_EVENT_CALLBACK_NESTED_TIMELINE_BEAT 0x00040000
#define FMOD_STUDIO_EVENT_CALLBACK_ALL 0xFFFFFFFF
enum Studio.EVENT_CALLBACK_TYPE : uint
{
CREATED = 0x00000001,
DESTROYED = 0x00000002,
STARTING = 0x00000004,
STARTED = 0x00000008,
RESTARTED = 0x00000010,
STOPPED = 0x00000020,
START_FAILED = 0x00000040,
CREATE_PROGRAMMER_SOUND = 0x00000080,
DESTROY_PROGRAMMER_SOUND = 0x00000100,
PLUGIN_CREATED = 0x00000200,
PLUGIN_DESTROYED = 0x00000400,
TIMELINE_MARKER = 0x00000800,
TIMELINE_BEAT = 0x00001000,
SOUND_PLAYED = 0x00002000,
SOUND_STOPPED = 0x00004000,
REAL_TO_VIRTUAL = 0x00008000,
VIRTUAL_TO_REAL = 0x00010000,
START_EVENT_COMMAND = 0x00020000,
NESTED_TIMELINE_BEAT = 0x00040000,
ALL = 0xFFFFFFFF,
}
STUDIO_EVENT_CALLBACK_CREATED 0x00000001
STUDIO_EVENT_CALLBACK_DESTROYED 0x00000002
STUDIO_EVENT_CALLBACK_STARTING 0x00000004
STUDIO_EVENT_CALLBACK_STARTED 0x00000008
STUDIO_EVENT_CALLBACK_RESTARTED 0x00000010
STUDIO_EVENT_CALLBACK_STOPPED 0x00000020
STUDIO_EVENT_CALLBACK_START_FAILED 0x00000040
STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND 0x00000080
STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND 0x00000100
STUDIO_EVENT_CALLBACK_PLUGIN_CREATED 0x00000200
STUDIO_EVENT_CALLBACK_PLUGIN_DESTROYED 0x00000400
STUDIO_EVENT_CALLBACK_TIMELINE_MARKER 0x00000800
STUDIO_EVENT_CALLBACK_TIMELINE_BEAT 0x00001000
STUDIO_EVENT_CALLBACK_SOUND_PLAYED 0x00002000
STUDIO_EVENT_CALLBACK_SOUND_STOPPED 0x00004000
STUDIO_EVENT_CALLBACK_REAL_TO_VIRTUAL 0x00008000
STUDIO_EVENT_CALLBACK_VIRTUAL_TO_REAL 0x00010000
STUDIO_EVENT_CALLBACK_START_EVENT_COMMAND 0x00020000
STUDIO_EVENT_CALLBACK_NESTED_TIMELINE_BEAT 0x00040000
STUDIO_EVENT_CALLBACK_ALL 0xFFFFFFFF
Callbacks are called from the Studio Update Thread in default / async mode and the main (calling) thread in synchronous mode.
If using FMOD_STUDIO_INIT_DEFERRED_CALLBACKS, FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER and FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT are instead called from the main thread.
See Also: Callback Behavior, Studio::EventDescription::setCallback, Studio::EventInstance::setCallback, FMOD_STUDIO_EVENT_CALLBACK
These definitions describe built-in event properties.
typedef enum FMOD_STUDIO_EVENT_PROPERTY {
FMOD_STUDIO_EVENT_PROPERTY_CHANNELPRIORITY,
FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY,
FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_LOOKAHEAD,
FMOD_STUDIO_EVENT_PROPERTY_MINIMUM_DISTANCE,
FMOD_STUDIO_EVENT_PROPERTY_MAXIMUM_DISTANCE,
FMOD_STUDIO_EVENT_PROPERTY_COOLDOWN,
FMOD_STUDIO_EVENT_PROPERTY_MAX
} FMOD_STUDIO_EVENT_PROPERTY;
enum Studio.EVENT_PROPERTY
{
CHANNELPRIORITY,
SCHEDULE_DELAY,
SCHEDULE_LOOKAHEAD,
MINIMUM_DISTANCE,
MAXIMUM_DISTANCE,
COOLDOWN,
MAX
};
STUDIO_EVENT_PROPERTY_CHANNELPRIORITY
STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY
STUDIO_EVENT_PROPERTY_SCHEDULE_LOOKAHEAD
STUDIO_EVENT_PROPERTY_MINIMUM_DISTANCE
STUDIO_EVENT_PROPERTY_MAXIMUM_DISTANCE
STUDIO_EVENT_PROPERTY_COOLDOWN
STUDIO_EVENT_PROPERTY_MAX
Priority to set on Core API Channels created by this event instance, or -1 for default.
Schedule delay in DSP clocks, or -1 for default.
Schedule look-ahead on the timeline in DSP clocks, or -1 for default.
Override the event's 3D minimum distance, or -1 for default.
Override the event's 3D maximum distance, or -1 for default.
Override the event's cooldown, or -1 for default.
A property that returns a value of -1 from Studio::EventInstance::getProperty means it will use the values set in Studio, use Studio::EventInstance::setProperty to override these values. You can revert the properties value to default by setting it to -1.
Describes a DSP plug-in instance.
typedef struct FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES {
const char *name;
FMOD_DSP *dsp;
} FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES;
struct Studio.PLUGIN_INSTANCE_PROPERTIES
{
IntPtr name;
IntPtr dsp;
}
FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES
{
name,
};
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_CREATED or FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_DESTROYED.
The dsp
argument can be cast to FMOD::DSP *
.
The 'name' argument can be used via StringWrapper
by using FMOD.StringWrapper dspName = new FMOD.StringWrapper(name);
The 'dsp' argument can be used via DSP
by using FMOD.DSP dspInstance = new FMOD.DSP(dsp);
See Also: FMOD_STUDIO_EVENT_CALLBACK
Describes a programmer sound.
typedef struct FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES {
const char *name;
FMOD_SOUND *sound;
int subsoundIndex;
} FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES;
struct Studio.PROGRAMMER_SOUND_PROPERTIES
{
StringWrapper name;
IntPtr sound;
int subsoundIndex;
}
FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES
{
name,
sound,
subsoundIndex,
};
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND or FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND.
When the callback type is FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND the callback should fill in the sound
and subsoundIndex
fields. The provided sound should be created with the FMOD_LOOP_NORMAL mode bit set. FMOD will set this bit internally if it is not set, possibly incurring a performance penalty. The subsound index should be set to the subsound to play, or -1 if the provided sound should be used directly.
When the callback type is FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND the sound in sound
should be cleaned up.
sound
can be cast to/from FMOD::Sound *
.
See Also: FMOD_STUDIO_EVENT_CALLBACK
Stop modes.
typedef enum FMOD_STUDIO_STOP_MODE {
FMOD_STUDIO_STOP_ALLOWFADEOUT,
FMOD_STUDIO_STOP_IMMEDIATE
} FMOD_STUDIO_STOP_MODE;
enum Studio.STOP_MODE
{
ALLOWFADEOUT,
IMMEDIATE,
}
STUDIO_STOP_ALLOWFADEOUT
STUDIO_STOP_IMMEDIATE
See Also: Studio::EventInstance::stop, Studio::Bus::stopAllEvents
Describes a beat on the timeline.
typedef struct FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES {
int bar;
int beat;
int position;
float tempo;
int timesignatureupper;
int timesignaturelower;
} FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES;
struct Studio.TIMELINE_BEAT_PROPERTIES
{
int bar;
int beat;
int position;
float tempo;
int timesignatureupper;
int timesignaturelower;
}
FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES
{
bar,
beat,
position,
tempo,
timesignatureupper,
timesignaturelower,
};
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT.
Nested events do not trigger this callback. Instead, see FMOD_STUDIO_EVENT_CALLBACK_NESTED_TIMELINE_BEAT.
See Also: FMOD_STUDIO_EVENT_CALLBACK
Describes a marker on the timeline.
typedef struct FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES {
const char *name;
int position;
} FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES;
struct Studio.TIMELINE_MARKER_PROPERTIES
{
IntPtr name;
int position;
}
FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES
{
name,
position,
};
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER.
See Also: Studio::EventDescription::setCallback, Studio::EventInstance::setCallback
Describes a beat on the timeline from a nested event.
typedef struct FMOD_STUDIO_TIMELINE_NESTED_BEAT_PROPERTIES {
FMOD_GUID eventid;
FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES properties;
} FMOD_STUDIO_TIMELINE_NESTED_BEAT_PROPERTIES;
struct Studio.TIMELINE_NESTED_BEAT_PROPERTIES
{
Guid eventid;
TIMELINE_BEAT_PROPERTIES properties;
}
FMOD_STUDIO_TIMELINE_NESTED_BEAT_PROPERTIES
{
eventid,
properties,
};
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_NESTED_TIMELINE_BEAT.
See Also: FMOD_STUDIO_EVENT_CALLBACK, FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT