WwiseWorld - stingray.WwiseWorld object reference - Stingray Lua API Reference

stingray.WwiseWorld object reference

Description

This object provides access to functions for controlling sound events for a particular game World.

Listeners

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

listener_id :

integer

The Id of the listener to set as a default. Use Wwise.LISTENER_0 through Wwise.LISTENER_7.

Returns
This function does not return any values.

When a new source is created, it is added to the default listeners. By default, the only default listener is Wwise.LISTENER_0.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

listener_id :

integer

The id of the listener to remove from the list of default listeners. Use Wwise.LISTENER_0 through Wwise.LISTENER_7.

Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

listener_id :

integer

The index of the listener to set. Use Wwise.LISTENER_0 through Wwise.LISTENER_7.

transform :

stingray.Matrix4x4

The new position and rotation for the specified listener.

Returns
This function does not return any values.

8 listeners are supported.

Sources

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

listener_id :

integer

The numeric ID of the listener to assign. Use Wwise.LISTENER_0 through Wwise.LISTENER_7.

Returns
This function does not return any values.

When a new source is created, its initial listener mask is set up with the list of default listeners. This function allows you to assign additional listeners to selected sources.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

source_id :

integer

The numeric ID of the source.

listener_id :

integer

The numeric ID of the listener to assign. Use Wwise.LISTENER_0 through Wwise.LISTENER_7.

Returns
This function does not return any values.

When a new source is created, its initial listener mask is set up with the list of default listeners. This function allows you to assign additional listeners to selected sources.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

source_id :

integer

The numeric ID of the source to look for.

Returns

boolean

true if a source exists with the specified ID, or false otherwise.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

listener_id :

integer

The numeric ID of the listener to remove from the source. Use Wwise.LISTENER_0 through Wwise.LISTENER_7.

Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

source_id :

integer

The numeric ID of the source.

listener_id :

integer

The numeric ID of the listener to remove from the source. Use Wwise.LISTENER_0 through Wwise.LISTENER_7.

Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

source_id :

integer

The numeric ID of the source you want to move.

transform :

stingray.Matrix4x4

The new position and rotation for the specified source.

Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

source_id :

integer

The numeric ID of the source you want to move.

position :

stingray.Vector3

The new position for the specified source.

Returns
This function does not return any values.

Events

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

source_id :

integer

The numeric ID of an existing source.

Returns
This function does not return any values.

Destroying the source is required for sources which are created via make_manual_source() and configured for manual deletion. Any sounds currently playing on the source will become orphaned and continue to play until finished. For example if an event is playing on a unit source and that source is manually destroyed via destroy_manual_source(), the sound will continue to play at its last position. There is no way to re-attach the playing sound to another source. This function does not destroy sources which are set to be automatically destroyed when they have no active events.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

playing_id :

integer

The numeric ID of the playing event to obtain the position.

Returns

number

Time in milliseconds since start of event play.

Returns 0 if the given id does not correspond to a playing sound.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

event_id :

integer

The numeric ID of the active event.

Returns

boolean

true if a the id corresponds to a currently playing event, false otherwise.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

pose :

stingray.Matrix4x4

A Matrix4x4 used to create a new Wwise source.

Returns

integer

The ID of the source.

If invalid source input or other errors occur during source creation then WwiseWorldInterface::NO_SOURCE_ID will be returned. A Source created via make_auto_source is automatically cleaned up if it has no actively playing events.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

unit :

stingray.Unit

A Unit that will be used to create a new source or to find an existing source matching the given unit.

object :

integer?

This parameter can contain the numeric ID of an object within that unit.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

integer

The ID of the source.

If no existing matching unit source is found, then a new unit source will be created and its ID will be returned. If invalid source input or other errors occur during source creation then WwiseWorldInterface::NO_SOURCE_ID will be returned. A Source created via make_auto_source is automatically cleaned up if it has no actively playing events.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

position :

stingray.Vector3

A Vector3 used to create a new Wwise source.

rotation :

stingray.Quaternion?

This parameter can be a Quaternion that indicates the source rotation.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

integer

The ID of the source.

If invalid source input or other errors occur during source creation then WwiseWorldInterface::NO_SOURCE_ID will be returned. A Source created via make_auto_source is automatically cleaned up if it has no actively playing events.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

unit :

stingray.Unit

A Unit that will be used to create a new source or to find an existing source matching the given unit.

object :

integer?

This parameter can contain the numeric ID of an object within that unit.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

integer

The ID of the source.

If no existing matching unit source is found, then a new unit manual delete source will be created and its ID will be returned. If invalid source input or other errors occur during source creation then WwiseWorldInterface::NO_SOURCE_ID will be returned. A Source created via make_manual_source() requires destroy_manual_source() to be called in order to cleanup the source.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

position :

stingray.Vector3

A new Vector3 source.

rotation :

stingray.Quaternion?

This parameter can be a Quaternion that indicates the source rotation.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

integer

The ID of the source.

If invalid source input or other errors occur during source creation then WwiseWorldInterface::NO_SOURCE_ID will be returned. A Source created via make_manual_source() requires destroy_manual_source() to be called in order to cleanup the source.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

pose :

stingray.Matrix4x4

A new Matrix4x4 source.

Returns

integer

The ID of the source.

If invalid source input or other errors occur during source creation then WwiseWorldInterface::NO_SOURCE_ID will be returned. A Source created via make_manual_source() requires destroy_manual_source() to be called in order to cleanup the source.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

playing_id :

integer

The numeric ID of the event to be paused.

Returns
This function does not return any values.

You can resume the event with a call to resume_event() or resume_all().

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

playing_id :

integer

The numeric ID of the event to be resumed.

Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

playing_id :

integer

The playing sound that was created via trigger_audio_input_sound.

Returns
This function does not return any values.

This is required to stop infinitely looping sounds. Sounds created via the trigger_audio_input_event interface can be stopped via the normal event methods.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

playing_id :

integer

The numeric ID of the event to be stopped.

Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

source_id :

integer

The game object to play the sound on.

event_name :

string

The name of the event.

stream_source :

stingray.SoundStreamSource

The audio stream data to use to play the sound.

Returns

integer

The numeric ID of the new playing event or nil if playing failed.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

source_id :

integer

The game object to play the sound on.

stream_source :

stingray.SoundStreamSource

The audio stream data to use to play the sound.

Returns

integer

The numeric ID of the new playing event or nil if playing failed.

If looping, the sound must be stopped via stop_audio_input_sound.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

event_name :

string

The name of the event.

Returns

integer

The numeric ID of the new playing event.

integer

The ID of the source playing the new event.

This source is used to play 2D sounds.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

event_name :

string

The name of the event.

source_id :

integer

A preexisting SourceId to trigger the event on.

Returns

integer

The numeric ID of the new playing event.

integer

The ID of the source playing the new event.

This source is used to play 2D sounds.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

event_name :

string

The name of the event.

pose :

stingray.Matrix4x4

A Matrix4x4 used to create a new Wwise source.

Returns

integer

The numeric ID of the new playing event.

integer

The ID of the source playing the new event.

The newly created source will be destroyed when it has no active playing events.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

event_name :

string

The name of the event.

position :

stingray.Vector3

A Vector3 used to create a new Wwise source.

rotation :

stingray.Quaternion?

This parameter can be a Quaternion that indicates the source rotation.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

integer

The numeric ID of the new playing event.

integer

The ID of the source playing the new event.

The newly created source will be destroyed when it has no active playing events.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

event_name :

string

The name of the event.

unit :

stingray.Unit

A Unit that will be used to create a new source or to find an existing source matching the given unit.

unit_object :

integer?

This parameter can contain the numeric index of an object within the given unit.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

integer

The numeric ID of the new playing event.

integer

The ID of the source playing the new event.

If no existing matching unit source is found, then a new unit source will be created and its ID will be returned. The newly created source will be destroyed when it has no active playing events.

Parameters

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

source_id :

integer

The source ID.

name :

string

The trigger name.

Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

name :

string

The name of the parameter to be routed.

value :

number

The numeric value for the parameter.

Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

source_id :

integer

The numeric ID of the source.

name :

string

The name of the parameter to be routed.

value :

number

The numeric value for the parameter.

Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

group :

string

The state group. Must match wwise project state setup.

state :

string

The current state. Must match wwise project state setup.

source_id :

integer

The associated source ID.

Returns
This function does not return any values.

Note this must be set before triggering events on a source for the switch value to apply to the event. Use make_source before trigger_event to obtain a new source id to set the switch on before triggering the event.

Environments

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.

Applies to all sources in the given world.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

value :

number

The bus value to send. 0 to 1.

Returns
This function does not return any values.

The dry value defaults to 1 (full).

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

source :

integer

The source.

value :

number

The bus value to send. 0 to 1.

Returns
This function does not return any values.

The dry value for all sources defaults to 1 (full).

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

name :

string

The auxiliary bus name.

value :

number

The bus value to send. 0 to 1.

Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

source :

integer

The source.

name :

string

The auxiliary bus name.

value :

number

The bus value to send. 0 to 1.

Returns
This function does not return any values.

Each source can have a maximum of MAX_ENVIRONMENTS_PER_OBJECT(4) unique active aux bus environments.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

listener :

integer

The listener id. Use Wwise.LISTENER_0 through Wwise.LISTENER_7.

source :

integer

The source.

obstruction :

number

How much the source is blocked. 0 to 1.

occlusion :

number

How much the source is occluded. 0 to 1.

Returns
This function does not return any values.

Soundscape

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

event_name :

string

The Wwise event name to trigger when the source is active.

unit :

stingray.Unit

The unit to use for positioning. The unit's position, scale, and rotation are used to define the shape bounds.

unit_object :

integer

The unit object node index.

shape_type :

integer

Shape enum value for a Soundscape source. Supported values: Wwise.SHAPE_POINT, Wwise.SHAPE_SPHERE, Wwise.SHAPE_BOX.

shape_scale :

any(number, stingray.Vector3)

Vector3 extents for Wwise.SHAPE_BOX, float for Wwise.SHAPE_POINT and Wwise.SHAPE_SPHERE. Value is ignored for SHAPE_POINT.

The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.

positioning :

integer

Wwise source behavior within the shape. Supported values: Wwise.POSITIONING_CLOSEST_TO_LISTENER, Wwise.POSITIONING_RANDOM_IN_SHAPE, Wwise.POSITIONING_RANDOM_AROUND_LISTENER.

min_distance :

number

Minimum distance for Random Around Listener positioning.

max_distance :

number

Maximum distance for Random Around Listener positioning.

trigger_range :

number?

Optional range to use to trigger the event. By default the event's maximum attenuation distance is used.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

integer

The id of the Soundscape source. This id is not a wwise source id. It is specific to the Soundscape add/remove functionality.

Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

ss_source_id :

integer

The Soundscape source Id.

Returns
This function does not return any values.
Parameters

self :

stingray.WwiseWorld

Specifies the object instance that this function will act on.

You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation.

ss_source :

integer

The soundscape source id that was returned from add_soundscape_source.

obstruction :

number

How much the source is blocked. 0 to 1.

occlusion :

number

How much the source is occluded. 0 to 1.

Returns
This function does not return any values.

Soundscape source ids are returned from add_soundscape_unit_source.