# 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](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.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](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **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](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **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](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **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](https://help.sansar.com/hc/en-us/articles/115003438283) **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](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean) **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](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **OnFinished** ([Action](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.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](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **SetLoudness** ([float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) 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](https://help.sansar.com/hc/en-us/articles/115003549048#M: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](https://help.sansar.com/hc/en-us/articles/115003549048#M: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](https://help.sansar.com/hc/en-us/articles/115003549048#M: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](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **SetPitchShift** ([float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) 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](https://help.sansar.com/hc/en-us/articles/115003549048#M: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](https://help.sansar.com/hc/en-us/articles/115003549048#M: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](https://help.sansar.com/hc/en-us/articles/115003549048#M: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](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.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](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **Stop** ([bool](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean) 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
>
> ***

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sansar.com/latest/script-api-docs/sansar-simulation-namespace/playhandle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
