> For the complete documentation index, see [llms.txt](https://danil-dukhovenko.gitbook.io/force/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://danil-dukhovenko.gitbook.io/force/force-scripting-api/force/audiomanager.md).

# AudioManager

static class AudioManager

### Description

**AudioEngine** holds all audio's that we loaded in memory, allows play its throw the [AuidoSource](/force/force-scripting-api/force/audiosource.md)'s by Force, and receive input to computer device throw [AudioListener](/force/force-scripting-api/force/audiolistener.md).\
&#x20;

### Static Methods

|                                                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">ReloadAudioDevice</mark>  | <p>Reloads the audio device. Call this method only if output sound device was removed, suspended or changed.<br>This method will reload all audio data stored in <mark style="color:red;">AudioManager</mark>.  So if you scene has to much non-streaming audio clips it can take some time.<br><br>This method called automatically by <strong>Force</strong> when user change system audio device, but in some situations event that comes from <strong>OS</strong> can be ignored by <strong>Force</strong>, and it that case you can call it manually.</p> |
| <mark style="color:red;">Play</mark>               | Play the audio clip from input [AudioSource](/force/force-scripting-api/force/audiosource.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| <mark style="color:red;">Pause</mark>              | Pause the audio clip from input [AudioSource](/force/force-scripting-api/force/audiosource.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <mark style="color:red;">Resume</mark>             | Resume the audio clip from input [AudioSource](/force/force-scripting-api/force/audiosource.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| <mark style="color:red;">Stop</mark>               | Stops the audio clip from input [AudioSource](/force/force-scripting-api/force/audiosource.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <mark style="color:red;">GetAudioListener</mark>   | <p>Returns the <a href="/force/force-scripting-api/force/audiolistener.md"><mark style="color:$primary;">AudioListener</mark></a> component from target scene.<br>If AudioListener was not found null returned.</p>                                                                                                                                                                                                                                                                                                                                            |
| <mark style="color:red;">GetAudioDataCount</mark>  | Returns the count of loaded audio data in memory.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| <mark style="color:red;">GetAudioDeviceName</mark> | Returns the current device that was already installed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

### Examples

Using **AudioEngine** to print the user audio device speaker name.

```csharp

using Force;

public class ExampleAudioEngine : MonoScript {

	// Runs when scene starts to play.
	public void OnStart() {
		Debug.Log(AudioEngine.GetAudioDeviceName());
	}

	// Runs every game cycle.
	public void OnUpdate(float delta) {
	}
}
```

### See Also

[AudioSource](/force/force-scripting-api/force/audiosource.md), [AudioListener](/force/force-scripting-api/force/audiolistener.md), [AudioClip](/force/force-scripting-api/force/audioclip.md)
