# Music Player

The Music Player allows you to play your locally downloaded music and control it via the [Music Player Action](/docs/actions/music-player-action). The Music Player page shows a Now Playing area with album art and a track scrubber that lets you seek within the current song, along with the full queue of songs.

## Managing The Queue

Songs can be added to the queue in several ways using the buttons on the Music Player page:

- **Add File To Queue:** Adds an individual music file to the queue.
- **Add Folder To Queue:** Adds all valid music files from the selected folder and every nested sub-folder beneath it, at any depth (not just the direct/first-level sub-folders), to the queue.
- **Add Playlist To Queue:** Adds the contents of an M3U/M3U8 playlist file to the queue.

The queue itself can be managed directly:

- Songs can be reordered by dragging and dropping them within the queue.
- Individual songs can be removed from the queue with the Remove From Queue option.
- The entire queue can be cleared with the Clear Queue option.
- The current queue can be saved with the Export Queue As M3U Playlist option for later re-use.

## Shuffle & Repeat

The Music Player has Shuffle and Repeat modes that can be toggled from the Music Player page or via the [Music Player Action](/docs/actions/music-player-action). Both modes persist between sessions of Mix It Up.

## Supported File Formats

The following are the list of supported music file formats:

- MP3
- WAV
- FLAC
- MP4
- M4A
- AAC
- WMA

## Special Identifiers

The following Special Identifiers can be used through the app for information about the Music Player feature:

- $musicplayertitle - The title of the currently playing song.
- $musicplayerartist - The artist of the currently playing song.
- $musicplayerdisplay - The full display information of the currently playing song, either containing both the artist and title if it had an artist or just the title otherwise.
- $musicplayerstate - The current state of the music player, will be one of the following values: Stopped, Playing, Paused
- $musicplayerlength - The raw length of the playing song in seconds (EX: 245)
- $musicplayerduration - The formatted length of the playing song (EX: 4:05)

## Recommended Music Sites

Below is a list of websites that we recommend to use for music, as they both allow for playing through your stream without worry for copyright claims and allow you to download the music locally on to your computer:

- [No Copyright Sounds](https://ncs.io)
- [StreamBeats](https://www.senpai.tv/streambeats/)
- [EpidemicSounds](https://www.epidemicsound.com/)
- [Free Music Archive](https://freemusicarchive.org/search?adv=1&music-filter-CC-attribution-only=1&music-filter-public-domain=1&music-filter-commercial-allowed=1&music-filter-remix-allowed=1)

If there are additional sites that you know about and would like to recommend, please reach out to us in our Discord support server and we'll be happy to add more to the list!

## Additional Music Providers

Didn't find specific music you were looking for? Below are some additional music providers that you can use separately from Mix It Up that also have safe copyright usage for streams through their own app / service:

- [Pretzel Rocks](https://www.pretzel.rocks)
- [Monstercat](https://www.monstercat.com)

## Why not YouTube / Spotify?

A common question that is asked is why the Music Player service does not allow for integration with YouTube or Spotify. The reason for this comes down to the Terms of Service for both, which do not allow the re-broadcasting of content from their services (IE, you are not allowed to play music from them in your stream). You can find detailed information at the link below related to why our initial Song Requests feature was removed in the past due to those same reasons:

[Song Requests Removal](https://mixitup.bot/songrequests)

---

## Music Player Action

The Music Player Action allows you to control the [Music Player](/docs/music-player) service in Mix It Up.

This action supports the following options:

- **Play/Pause:** Plays or pauses the current song based on the current state.
- **Play:** Plays the current song.
- **Play Specific Song:** Searches for a song with a title containing the specified text and plays the song with the closest matching title.
- **Pause:** Pauses the currently playing song.
- **Stop:** Stops the currently playing song and sets the time for it back to the start.
- **Next:** Plays the next song in the list.
- **Previous:** Plays the previous song in the list.
- **Change Volume:** Changes the current volume of the Music Player.
- **Change Folder:** Changes the current folder for songs and loads in all of the songs in from that folder path.
- **Shuffle On:** Turns Shuffle mode on.
- **Shuffle Off:** Turns Shuffle mode off.
- **Shuffle Toggle:** Toggles Shuffle mode between on and off.
- **Repeat On:** Turns Repeat mode on.
- **Repeat Off:** Turns Repeat mode off.
- **Repeat Toggle:** Toggles Repeat mode between on and off.
- **Clear Queue:** Removes all songs from the Music Player queue.
