> For the complete documentation index, see [llms.txt](https://bonsai-docs.gitbook.io/bonsai-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bonsai-docs.gitbook.io/bonsai-docs/bonsai-radio/media-setup/adding-music.md).

# Adding Music

Adding music to Bonsai Radio is done by placing audio files inside the folder belonging to the radio station.

After adding or removing music, the media scanner must be run so Bonsai Radio can update its media library.

### Supported Audio Formats

Bonsai Radio officially supports:

* `.mp3`
* `.ogg`

MP3 is the recommended format for most servers.\
\
Avoid using extremely large audio files. Large files increase the resource download size and may increase loading times for players.<br>

#### Step 1: Find the Station Folder

Open the Bonsai Radio resource and navigate to:

```
bonsai_radio/html/media/
```

Inside this folder, each radio station has its own media folder.

Example:

```
bonsai_radio/
└── html/
    └── media/
        ├── generations/
        ├── west_coast/
        ├── funk/
        └── country/
```

The folder used by a station is configured in the station configuration.

For example, a station configured to use:

```
folder = 'generations'
```

will load its music from:

```
html/media/generations/
```

#### Step 2: Add the Music Files

Copy your music files into the folder belonging to the station.

Example:

```
html/media/generations/johndoe.mp3
html/media/generations/loremipsum.mp3
html/media/generations/jenkins.mp3
```

You may use either MP3 or OGG files.

{% hint style="info" %}
Use simple filenames whenever possible. Avoid unusual symbols, emojis and extremely long filenames.
{% endhint %}

Recommended filename:

```
johndoe_loremipsum.mp3
```

Not recommended:

```
John Doe - Lorem Ipsum [Official Music Video] (2024) 🔥🔥.mp3
```

#### Step 3: Run the Media Scanner

After adding the songs, return to the main Bonsai Radio resource folder and run:

```
auto_scan_media.bat
```

The scanner will search the configured media folders and update:

```
data/media_library.json
```

When the scanner finishes, it will display how many songs, advertisements and jingles were found.

Example:

```
Songs: 183
Ads: 24
Jingles: 16
```

{% hint style="warning" %}
Do not manually add songs directly to `media_library.json`.

The file is generated automatically by the media scanner and may be overwritten the next time the scanner is run.
{% endhint %}

#### Step 4: Restart Bonsai Radio

After the scan has completed, restart the resource:

```
restart bonsai_radio
```

The newly added songs should now be available on the configured station.


---

# 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, and the optional `goal` query parameter:

```
GET https://bonsai-docs.gitbook.io/bonsai-docs/bonsai-radio/media-setup/adding-music.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
