PlayHandle

PlayHandle Class

The PlayHandle represents audio play handles.

Syntax

[Sansar.Script.Interface]
public class PlayHandle : Sansar.Script.InstanceInterface, IDisposable

Remarks

 

Requirements

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

Members

See Also: Inherited members from Sansar.Script.InstanceInterface.

Public Properties

[read-only]
 
IsValid bool . Whether or not this interface is valid. (Inherited from Sansar.Script.InstanceInterface.)

Public Methods

 
Dispose ()
Releases resources held by this instance.
 
Finalize ()
 
GetLoudness () : float
Retrieves the loudness for this PlayHandle.
 
GetPitchShift () : float
Retrieves the relative pitch for this PlayHandle.
 
GetRemainingSeconds () : float
Returns the number of seconds remaining.
 
GetStatus () : PlayStatus
Returns the current PlayStatus.
 
IsPlaying () : bool
Returns whether the sound is currently playing.
 
OnFinished (Action)
Triggers action when this sound is finished playing. Doesn't trigger if stopped or looping.
 
SetLoudness (float)
Sets the loudness for this PlayHandle.
 
SetLoudness (float, Sansar.Script.ScriptBase.OperationComplete) : ulong
Sets the loudness for this PlayHandle.
 
SetLoudness (float, Action<Sansar.Script.OperationCompleteEvent>)
Sets the loudness for this PlayHandle.
 
SetPitchShift (float)
Sets the relative pitch for this PlayHandle.
 
SetPitchShift (float, Sansar.Script.ScriptBase.OperationComplete) : ulong
Sets the relative pitch for this PlayHandle.
 
SetPitchShift (float, Action<Sansar.Script.OperationCompleteEvent>)
Sets the relative pitch for this PlayHandle.
 
Stop ()
Stops the sound on this PlayHandle.
 
Stop (Sansar.Script.ScriptBase.OperationComplete) : ulong
Stops the sound on this PlayHandle.
 
Stop (Action<Sansar.Script.OperationCompleteEvent>)
Stops the sound on this PlayHandle.
 
Stop (bool)
Stops the sound on this PlayHandle.
 
Stop (bool, Sansar.Script.ScriptBase.OperationComplete) : ulong
Stops the sound on this PlayHandle.
 
Stop (bool, Action<Sansar.Script.OperationCompleteEvent>)
Stops the sound on this PlayHandle.

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

void Finalize ()

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

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetLoudness (float loudness, Sansar.Script.ScriptBase.OperationComplete handler)

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

[Sansar.Script.Interface]
public void SetLoudness (float loudness, Action<Sansar.Script.OperationCompleteEvent> handler)

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

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetPitchShift (float pitch, Sansar.Script.ScriptBase.OperationComplete handler)

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

[Sansar.Script.Interface]
public void SetPitchShift (float pitch, Action<Sansar.Script.OperationCompleteEvent> handler)

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

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong Stop (Sansar.Script.ScriptBase.OperationComplete handler)

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 (Action<Sansar.Script.OperationCompleteEvent> handler)

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

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong Stop (bool fadeout, Sansar.Script.ScriptBase.OperationComplete handler)

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

[Sansar.Script.Interface]
public void Stop (bool fadeout, Action<Sansar.Script.OperationCompleteEvent> handler)

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


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.