Sansar Docs
Ask or search…
K

PlayHandle

PlayHandle Class

The PlayHandle represents audio play handles.

Syntax

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Members

Member Details

Dispose Method

Releases resources held by this instance.

Syntax

[Sansar.Script.Interface] public void Dispose ()

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Finalize Method

Syntax

Remarks

Ensures that this instance has been Disposed.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

GetLoudness Method

Retrieves the loudness for this PlayHandle.

Syntax

[Sansar.Script.Interface] public float GetLoudness ()
Returns
The loudness (in dB).

Remarks

This synchronous method returns the broadcasted loudness. It does not wait to hear back from clients.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

GetPitchShift Method

Retrieves the relative pitch for this PlayHandle.

Syntax

[Sansar.Script.Interface] public float GetPitchShift ()
Returns
The relative pitch.

Remarks

This synchronous method returns the broadcasted pitch. It does not wait to hear back from clients.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

GetRemainingSeconds Method

Returns the number of seconds remaining.

Syntax

[Sansar.Script.Interface] public float GetRemainingSeconds ()
Returns
The number of seconds remaining. (0 if done playing, -1 if looped)

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

GetStatus Method

Returns the current PlayStatus.

Syntax

[Sansar.Script.Interface] public PlayStatus GetStatus ()
Returns
The current PlayStatus.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

IsPlaying Method

Returns whether the sound is currently playing.

Syntax

[Sansar.Script.Interface] public bool IsPlaying ()
Returns
true if currently playing

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

OnFinished Method

Triggers action when this sound is finished playing. Doesn't trigger if stopped or looping.

Syntax

[Sansar.Script.Interface] public void OnFinished (Action handler)
Parameters
handler
Action to be called when the sound finishes playing.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

SetLoudness Method

Sets the loudness for this PlayHandle.

Syntax

[Sansar.Script.Interface] public void SetLoudness (float loudness)
Parameters
loudness
The loudness (in dB).
Returns
The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

SetLoudness Method

Sets the loudness for this PlayHandle.

Syntax

Parameters
loudness
The loudness (in dB).
handler
Handler to be called when the event completes.
Returns
The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

SetLoudness Method

Sets the loudness for this PlayHandle.

Syntax

Parameters
loudness
The loudness (in dB).
handler
Handler to be called when the event completes.
Returns
The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

SetPitchShift Method

Sets the relative pitch for this PlayHandle.

Syntax

[Sansar.Script.Interface] public void SetPitchShift (float pitch)
Parameters
pitch
The relative pitch in semitones. (default = 0)
Returns
The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

SetPitchShift Method

Sets the relative pitch for this PlayHandle.

Syntax

Parameters
pitch
The relative pitch in semitones. (default = 0)
handler
Handler to be called when the event completes.
Returns
The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

SetPitchShift Method

Sets the relative pitch for this PlayHandle.

Syntax

Parameters
pitch
The relative pitch in semitones. (default = 0)
handler
Handler to be called when the event completes.
Returns
The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to Sansar.Script.ScriptBase.WaitFor while in a coroutine.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Stop Method

Stops the sound on this PlayHandle.

Syntax

[Sansar.Script.Interface] public void Stop ()
Returns
The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Stop Method

Stops the sound on this PlayHandle.

Syntax

Parameters
handler
Handler to be called when the event completes.
Returns
The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Stop Method

Stops the sound on this PlayHandle.

Syntax

Parameters
handler
Handler to be called when the event completes.
Returns
The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Stop Method

Stops the sound on this PlayHandle.

Syntax

[Sansar.Script.Interface] public void Stop (bool fadeout)
Parameters
fadeout
Will fade out if true.
Returns
The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Stop Method

Stops the sound on this PlayHandle.

Syntax

Parameters
fadeout
Will fade out if true.
handler
Handler to be called when the event completes.
Returns
The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Stop Method

Stops the sound on this PlayHandle.

Syntax

Parameters
fadeout
Will fade out if true.
handler
Handler to be called when the event completes.
Returns
The return value is an internal event id.

Remarks

This asynchronous method queues the write then returns.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0