> For the complete documentation index, see [llms.txt](https://sparkar-community.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sparkar-community.gitbook.io/docs/audiomodule/playbackcontroller.md).

# PlaybackController

The `PlaybackController` class enables control of audio playback.

## Properties

This module exposes no properties.

## Methods

| Method       | Description                                                                                                                                                                                                                                       |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `loop`       | <p><code>loop(): void</code></p><p>Deprecated: Please use the <code>setLooping</code> method. Loop the playback controller, sound comes through all speakers (also known as Audio Source in the past) that reference the playback controller.</p> |
| `play`       | <p><code>play(): void</code></p><p>Deprecated: Please use the <code>setPlaying</code> method. Play the playback controller, sound comes through all speakers (also known as Audio Source in the past) that reference the playback controller.</p> |
| `reset`      | <p><code>reset(): void</code></p><p>Resets the playback controller audio to the beginning. If the playback controller is currently playing then it will immediately re-start.</p>                                                                 |
| `setLooping` | <p><code>setLooping(looping: BoolValue): void</code></p><p>Loops the playback controller. To be used in pair with the <code>setPlaying</code> method. If set to <code>true</code>, the audio will repeat infinitely.</p>                          |
| `setPlaying` | <p><code>setPlaying(playing: BoolValue): void</code></p><p>Plays or pauses the playback controller depending on the value entered. When the audio is finished playing, use <code>reset</code> to play from the beginning.</p>                     |
| `stop`       | `stop(): void` Deprecated: Please use the `setPlaying` method to pause the audio or the `reset` method to return the audio to the beginning. Stop the playback controller.                                                                        |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://sparkar-community.gitbook.io/docs/audiomodule/playbackcontroller.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.
