Sound

Sound is a type of representation that represents a sound.
You can have sound effects, ambient sounds,... //TODO

Method Summary
 niladdRepresentation (representation toAdd)
 numbergetFactor ()
 stringgetID ()
 Object, string, InterModel, boolean, stringgetListenerOnBegin ()
 Object, string, InterModel, boolean, stringgetListenerOnend ()
 MediaItemgetMediaItem ()
 numbergetPitch ()
 number, number, numbergetPosition ()
 numbergetRange ()
 representationgetRepresentation (string name, number type)
 representationgetRepresentationContainer ()
 array{}getRepresentations ()
 numbergetType ()
 numbergetVolume ()
 booleanhasListenerOnBegin ()
 booleanhasListenerOnEnd ()
 booleanhasRepresentation (representation other)
 booleanhasRepresentation (string name, number type)
 booleanisAttached ()
 booleanisLoop ()
 booleanisMultipleSources ()
 booleanisOnload ()
 booleanisPersistent ()
 nilpause ()
 nilplay ()
 nilprint ()
 nilremoveAllRepresentations ()
 nilremoveListenerOnBegin ()
 nilremoveListenerOnEnd ()
 nilremoveRepresentation (representation other)
 nilremoveRepresentation (string name, number type)
 nilsetAttached (boolean attaced)
 nilsetFactor (number sound)
 nilsetListenerOnBegin (Object target, string name, InterModel interactionModel)
 nilsetListenerOnEnd (Object target, string name, InterModel interactionModel)
 nilsetLoop (boolean loop)
 nilsetMediaItem (MediaItem sound)
 nilsetMultipleSources (boolean multipleSources)
 nilsetOnload (boolean onload)
 nilsetPersistent (boolean persistent)
 nilsetPitch (number pitch)
 nilsetPosition (number x, number y, number z)
 nilsetRange (number sound)
 nilsetVolume (number volume)
 nilstop ()

Method Detail

addRepresentation

nil addRepresentation (representation toAdd)
Adds another representation to this representation.

Parameters:
representation toAdd - Representation to be added to this representation.


getFactor

number getFactor ()
Returns the factor set for this sound.

Returns:
number - The factor set for this sound, ranging from 0 to 1.


getID

string getID ()
Returns the representation ID.

Returns:
string - Representation ID.


getListenerOnBegin

Object, string, InterModel, boolean, string getListenerOnBegin ()
Returns the 'sound begin' listener.

Returns:
Object - The object that contains the interaction that will be executed.
string - The name of the interaction.
InterModel - Arguments of the interaction that will be executed when this listener is activated.
boolean - Whether the listener is global or not.
string - The channel of the event.


getListenerOnend

Object, string, InterModel, boolean, string getListenerOnend ()
Returns the 'sound end' listener.

Returns:
Object - The object that contains the interaction that will be executed.
string - The name of the interaction.
InterModel - Arguments of the interaction that will be executed when this listener is activated.
boolean - Whether the listener is global or not.
string - The channel of the event.


getMediaItem

MediaItem getMediaItem ()
Returns the sound Media Item.

Returns:
MediaItem - sound MediaItem containing the sound to be played.


getPitch

number getPitch ()
Returns the pitch set for this sound.

Returns:
number - The pitch set for this sound.


getPosition

number, number, number getPosition ()
Returns the position of the Sound.

Returns:
number - The position of the Sound in the X coordinate.
number - The position of the Sound in the Y coordinate.
number - The position of the Sound in the Z coordinate.


getRange

number getRange ()
Returns the range set for this sound.

Returns:
number - The range set for this sound, ranging from 0 to 1.


getRepresentation

representation getRepresentation (string name, number type)
Returns the contained representation with the specified name and type.

Parameters:
string name - The name of the contained representation.
number type - The type of the contained representation.

Returns:
representation - The contained representation with the specified name and type.


getRepresentationContainer

representation getRepresentationContainer ()
Returns the representation that contains this representation.

Returns:
representation - The representation that contains this representation.


getRepresentations

array{} getRepresentations ()
Returns an array of the contained representations.

Returns:
array{} - Array of the contained representations.


getType

number getType ()
Returns the representation type:
2 - MODEL,
3 - LIGHT,
4 - EFFECT,
5 - PLANE,
6 - WATER,
7 - SOUND,
8 - TERRAIN_MESH_DECAL,
9 - TERRAIN_HIGHLIGHTING_DECAL,
10 - BILLBOARD,
11 - OVERLAY

Returns:
number - The type of the representation.


getVolume

number getVolume ()
Returns the volume set for this sound.

Returns:
number - The volume set for this sound, ranging from 0 to 1.


hasListenerOnBegin

boolean hasListenerOnBegin ()
Returns 'true' if there is a listener attached to the event 'sound begin', otherwise 'false'.

Returns:
boolean - Whether there is a listener attached to the event 'sound begin'


hasListenerOnEnd

boolean hasListenerOnEnd ()
Returns 'true' if there is a listener attached to the event 'sound end', otherwise 'false'.

Returns:
boolean - Whether there is a listener attached to the event 'sound end'


hasRepresentation

boolean hasRepresentation (representation other)
Returns 'true' if this representation has the other representation, otherwise 'false'.

Parameters:
representation other - The other representation.

Returns:
boolean - 'True' if this representation has the other representation, otherwise 'false'.


hasRepresentation

boolean hasRepresentation (string name, number type)
Returns 'true' if this representation has another representation with the specified name and type, otherwise 'false'.

Parameters:
string name - Name of the representation.
number type - Type of the representation

Returns:
boolean - 'True' if this representation has another representation with the specified name and type, otherwise 'false'.


isAttached

boolean isAttached ()
Returns 'true' if the sound is attached to the current camera, otherwise 'false'.

Returns:
boolean - 'True' if the sound is attached to the current camera, otherwise 'false'.


isLoop

boolean isLoop ()
Returns 'true' if the sound is set to play in loop, otherwise 'false'.

Returns:
boolean - 'True' if the sound is set to play in loop, otherwise 'false'.


isMultipleSources

boolean isMultipleSources ()
Returns 'true' if the sound can be playing in multiple sources simultaneously, otherwise 'false'.

Returns:
boolean - 'True' if the sound can be playing in multiple sources simultaneously, otherwise 'false'.


isOnload

boolean isOnload ()
Returns 'true' if the sound is set to play on load, otherwise 'false'.

Returns:
boolean - 'True' if the sound is set to play on load, otherwise 'false'.


isPersistent

boolean isPersistent ()
Returns true if the representation is persistent, false otherwise.

Returns:
boolean - Whether the Sound is persistent or not.


pause

nil pause ()
Pauses the sound playback.


play

nil play ()
Starts the sound playback.


print

nil print ()
Prints the Sound data and attributes to the console.


removeAllRepresentations

nil removeAllRepresentations ()
Removes all representations contained in this representation.


removeListenerOnBegin

nil removeListenerOnBegin ()
Removes the listener from the 'sound begin' event.


removeListenerOnEnd

nil removeListenerOnEnd ()
Removes the listener from the 'sound end' event.


removeRepresentation

nil removeRepresentation (representation other)
Removes a representation from this representation.

Parameters:
representation other - The representation to be removed.


removeRepresentation

nil removeRepresentation (string name, number type)
Removes a representation with the specified name and type from this representation.

Parameters:
string name - Name of the representation.
number type - Type of the representation


setAttached

nil setAttached (boolean attaced)
Sets whether the sound is attached to the current camera.

Parameters:
boolean attaced - Whether the sound is attached to the current camera.


setFactor

nil setFactor (number sound)
Sets the factor.

Parameters:
number sound - The factor. The factor is from 0 (off) to 1 (maximum).


setListenerOnBegin

nil setListenerOnBegin (Object target, string name, InterModel interactionModel)
Sets the listener to be invoked upon a 'sound begin' event.

Parameters:
Object target - The object that contains the interaction that will be executed.
string name - The name of the interaction.
InterModel interactionModel - Arguments of the interaction that will be executed when this listener is activated.


setListenerOnEnd

nil setListenerOnEnd (Object target, string name, InterModel interactionModel)
Sets the listener to be invoked upon a 'sound end' event.

Parameters:
Object target - The object that contains the interaction that will be executed.
string name - The name of the interaction.
InterModel interactionModel - Arguments of the interaction that will be executed when this listener is activated.


setLoop

nil setLoop (boolean loop)
Sets whether the sound plays in loop or not.

Parameters:
boolean loop - Whether the sound plays in loop or not.


setMediaItem

nil setMediaItem (MediaItem sound)
Sets the sound mediaitem.

Parameters:
MediaItem sound - MediaItem containing the sound to be played.


setMultipleSources

nil setMultipleSources (boolean multipleSources)
Sets whether the sound can be played in multiple sources simultaneously, or if it can only be played in one source at any given time.

Parameters:
boolean multipleSources - Whether the sound can be played in multiple sources simultaneously, or if it can only be played in one source at any given time.


setOnload

nil setOnload (boolean onload)
Sets whether the sound plays automatically upon loading.

Parameters:
boolean onload - Whether the sound plays automatically upon loading.


setPersistent

nil setPersistent (boolean persistent)
Makes the Sound persistent or not persistent.

Parameters:
boolean persistent - Whether the Sound is persistent or not.


setPitch

nil setPitch (number pitch)
Sets the pitch.

Parameters:
number pitch - The sound pitch.


setPosition

nil setPosition (number x, number y, number z)
Sets the position of the Sound in the 3D space (x,y,z).

Parameters:
number x - New position in the X axis.
number y - New position in the Y axis.
number z - New position in the Z axis.


setRange

nil setRange (number sound)
Sets the range.

Parameters:
number sound - The range. The range is from 0 (off) to 1 (maximum).


setVolume

nil setVolume (number volume)
Sets the volume.

Parameters:
number volume - The sound volume. The range is from 0 (off) to 1 (maximum).


stop

nil stop ()
Stops the sound playback.