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

# AudioManager

## Functional Example:&#x20;

Let's demonstrate how these functions can assist us in audio management within our game:

```python
extends Control

@onready var music: HSlider = $Parameters/VBoxContainer/HorizontalContainer/Sliders/Music
@onready var sfx: HSlider = $Parameters/VBoxContainer/HorizontalContainer/Sliders/SFX


func _ready():
	music.value = GodotEssentialsAudio.get_actual_volume_db_from_bus("Music")
	sfx.value = GodotEssentialsAudio.get_actual_volume_db_from_bus("SFX")


func _on_music_value_changed(value):
	GodotEssentialsAudio.change_volume("Music", value)


func _on_sfx_value_changed(value):
	change_volume("SFX", value)

```

The script above is a modification of the following script, incorporating our **GodotEssentialAudio** class. <https://github.com/godotessentials/Veneno/blob/main/scenes/ui/options.gd>

## API reference

### Accessible normal variables

* #### available\_buses: Array\[String]

&#x20;Here is an array list of the available buses set up in your project, for example:

```python
GodotEssentialsAudio.available_buses # returns ["Master", "Music", "SFX"]
```

***

### change\_volume(bus, value: float) -> void

Change the volume of selected **bus\_index** if it exists. Can receive the bus parameter as name or index.

```python
GodotEssentialsAudio.change_volume(1, 0.5)
GodotEssentialsAudio.change_volume("Music", 0.5)
```

### get\_actual\_volume\_db\_from\_bus\_name(name: String) -> float

Retrieve the current volume value for the selected bus by its name. If the `bus_name` does not exist in your project, it will raise an error and return a value of 0.0.

```python
GodotEssentialsAudio.get_actual_volume_db_from_bus("Music")
```

### get\_actual\_volume\_db\_from\_bus\_index(index: int) -> float

Retrieve the current volume value for the selected bus by its index.

```python
GodotEssentialsAudio.get_actual_volume_db_from_index(1)
GodotEssentialsAudio.get_actual_volume_db_from_index(AudioServer.get_bus_index("Music"))
```
