PlayHandle

PlayHandle Class

The PlayHandle represents audio play handles.

Syntax

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

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 Methods

  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 (floatSansar.Script.ScriptBase.OperationComplete) : ulong
Sets the loudness for this PlayHandle.
  SetLoudness (floatAction<Sansar.Script.OperationCompleteEvent>) : ulong
Sets the loudness for this PlayHandle.
  SetPitchShift (floatSansar.Script.ScriptBase.OperationComplete) : ulong
Sets the relative pitch for this PlayHandle.
  SetPitchShift (floatAction<Sansar.Script.OperationCompleteEvent>) : ulong
Sets the relative pitch for this PlayHandle.
  Stop (Sansar.Script.ScriptBase.OperationComplete) : ulong
Stop the sound from playing with no fadeout.
  Stop (Action<Sansar.Script.OperationCompleteEvent>) : ulong
Stop the sound from playing with no fadeout.
  Stop (boolSansar.Script.ScriptBase.OperationComplete) : ulong
Stops the sound on this PlayHandle.
  Stop (boolAction<Sansar.Script.OperationCompleteEvent>) : ulong
Stops the sound on this PlayHandle.

Member Details

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 ulong SetLoudness (float loudness, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

loudness
The loudness (in dB).
handler
The optional Action`1 to be called when the value is set.

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 ulong SetLoudness (float loudness, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

loudness
The loudness (in dB).
handler
The optional Action`1 to be called when the value is set.

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 ulong SetPitchShift (float pitch, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

pitch
The relative pitch in semitones. (default = 0)
handler
The optional Action`1 to be called when the value is set.

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 ulong SetPitchShift (float pitch, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

pitch
The relative pitch in semitones. (default = 0)
handler
The optional Action`1 to be called when the value is set.

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

Stop the sound from playing with no fadeout.

Syntax

[Sansar.Script.Interface]
public ulong Stop (Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

handler
An optional Sansar.Script.OperationCompleteEvent callback for when the sound has stopped.

Returns

Remarks

 

Requirements

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

Stop Method

Stop the sound from playing with no fadeout.

Syntax

[Sansar.Script.Interface]
public ulong Stop (Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

handler
An Sansar.Script.OperationCompleteEvent callback for when the sound has stopped.

Returns

Remarks

 

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 ulong Stop (bool fadeout, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

fadeout
Will fade out if true.
handler
The optional Action`1 to be called when the value is set.

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 ulong Stop (bool fadeout, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

fadeout
Will fade out if true.
handler
The optional Action`1 to be called when the value is set.

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.