🎧 a self-hosted Spotify → Discord music bot

Overview

Aoede is a Discord music bot that directly streams from Spotify to Discord. The only interface is Spotify itself.

Note: a Spotify Premium account is currently required. This is a limitation of librespot, the Spotify library Aoede uses.

Demo

💼 Usecases

  • Small servers with friends
  • Discord Stages, broadcast music to your audience

🏗 Usage

(Images are available for x86 and arm64.)

Docker Compose (recommended):

version: '3.4'

services:
  aoede:
    image: codetheweb/aoede
    restart: always
    volumes:
      - ./aoede:/data
    environment:
      - DISCORD_TOKEN=
      - SPOTIFY_USERNAME=
      - SPOTIFY_PASSWORD=
      - DISCORD_USER_ID= # Discord user ID of the user you want Aoede to follow

Prebuilt Binaries:

Prebuilt binaries are available on the releases page. Download the binary for your platform, then inside a terminal session:

  1. Set the required environment variables (see the Docker Compose section)
    • On Windows, you can use setx DISCORD_TOKEN my-token
    • On Linux / macOS, you can use export DISCORD_TOKEN=my-token
  2. Run the binary:
    • For Linux / macOS, ./platform-latest-aoede after navigating to the correct directory
    • For Windows, execute windows-latest-aoede.exe after navigating to the correct directory

Building from source:

Requirements:

  • automake
  • autoconf
  • cmake
  • libtool
  • Rust
  • Cargo

Run cargo build --release. This will produce a binary in target/release/aoede. Set the required environment variables (see the Docker Compose section), then run the binary.

Comments
  • Environment config not working

    Environment config not working

    I'm currently using the docker-compose given via portainer and provides the following error:

    Couldn't read config
    Missing field: 'DISCORD_TOKEN'
    

    All my environment vars are set and just following the provided docker-compose file:

    version: '3.4'
    
    services:
      aoede:
        image: codetheweb/aoede
        restart: always
        volumes:
          - ./aoede:/data
        environment:
          - DISCORD_TOKEN=discord.token.here
          - SPOTIFY_USERNAME=spotitest
          - SPOTIFY_PASSWORD=notarealpassword
          - DISCORD_USER_ID=targeteduserIDhere
    

    I think it's trying to read the config.toml where it shouldn't exist or somehow got bundled with the docker image

    opened by Wishdream 7
  • Getting Client Ended Error

    Getting Client Ended Error

    I am getting the Error:

    Client ended: Http(UnsuccessfulRequest(ErrorResponse { status_code: 401, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("discord.com")), port: None, path: "/api/v9/users/@me", query: None, fragment: None }, error: DiscordJsonError { code: 0, message: "401: Unauthorized", errors: [] } }))

    OS: Windows 11 Yes I did got email from Spotify for Login .

    opened by shubhankartrivedi 7
  • Sentry integration

    Sentry integration

    Maybe we should think about collecting errors and crashes via sentry.

    Don't know if that'd be too privacy invading/scary for users, some feedback would be great (@nodgear, @codetheweb)? Not sure if opt in or opt out would be the way to go tho...

    opened by cloudybyte 5
  • Volume Control not working

    Volume Control not working

    Hi & Merry Christmas! This Bot is exactly what I was looking for as a middleware for a bigger project, but I ran into a tiny tiny problem.... when trying to adjust the volume through spotify it doesn't seem to work.

    Unfortunately, I'm not into rust but still went ahead and tried to rebuild the bot with initial volume for librespot and also adjusting the volume in the enable_connect function, however, it doesn't affect the bot as well. Volume remains constant.

    Is there a way to adjust the initial volume of the bot?

    enhancement 
    opened by iKasu2k 4
  • Bot starts breifly, then stops abruptly.

    Bot starts breifly, then stops abruptly.

    Hi, I had hosted this bot roughly a year ago but lost the time to continue to manage it. Today I bought a new VPS with the aim of hosting the bot again. After doing the necessary installations, which I had to remind myself how to do, I've come into a problem. When I start the bot, it says that the bot starts well and asks for me to invite it to a Discord server and all, but I can see the bot go online and then offline almost instantly.

    I'm not sure what is causing this.

    opened by ryqm 3
  • Updated dependencies, new audio resampling library, performance improvements and volume control

    Updated dependencies, new audio resampling library, performance improvements and volume control

    Heyho @codetheweb,

    as promised some days ago in issue #9, here are my changes open to be discussed:

    • Updated dependencies:

    • Switched the library for audio resampling from samplerate to rubato:

      Samplerate is based on a c library and the function call used is not recommended for streamed audio because it does not work over chunk boundaries. As written in the docs:

      Perform a simple samplerate conversion of a large chunk of audio. This calls src_simple of libsamplerate which is not suitable for streamed audio.

      Therefore, this switch should make aoede more portable and additionally improve the audio quality.

    • Performance improvements:

      • Implemented non blocking EmittedSink::read.
      • Increased EmittedSink internal sync_channel buffer size to fit at least one resampling frame. And therefore, most times no synchronisation is necessary.
      • Changed datatype in internal sync_channel to fit the floats of both channels. This reduces the amount of synchronisations needed between EmittedSink::read and EmittedSink::write.
    • Implemented volume control using librespot::SoftMixer. Should close #9.

    I'm looking forward to hear from you. Best regards!

    opened by sibartel 3
  • Appear offline when disconnected from VC

    Appear offline when disconnected from VC

    Hi,

    Just wanted to ask, would you be interested in adding a toggleable feature that when aoede is disconnected from the channel the bot will then appear offline. I think it is definitely preference but with it not being invokable by commands some users ask questions about what the bot does.

    enhancement 
    opened by Brramble 3
  • improve docker builds

    improve docker builds

    We could think of publishing properly patched builds, so that people could use semantic versioning...

    Example:

    Version 1.4.2 just got released and now the docker image is being built. It should be tagged with: latest, v1, v1.4 and v1.4.2. This could include adding additional tags for different variants of the build after the last versioning digit (e.g. v1.4.2-alpine).

    And I'd change the runtime image to scratch if thats possible, though I'm not fully sure if that'll work

    opened by cloudybyte 2
  • Logging into Spotify using Facebook Account

    Logging into Spotify using Facebook Account

    Hello, I have attempted to get this working, and have gotten as far as setting my environment variables and running the .exe. This doesn't seem to have any effect, and my best guess is that my environment variables are incorrect. My Spotify Premium account is accessed through my Facebook account, using that as a login. I tried both my Facebook login email as well as the number Spotify assigned to my account, along with my Facebook password, but to no avail. To your knowledge, is this an issue in trying to run this bot?

    opened by Axel-of-the-Key 2
  • thread 'main' panicked at 'called `Result::unwrap()`

    thread 'main' panicked at 'called `Result::unwrap()`

    Keep getting this error when using docker-compose up, and when the docker container is running. Docker container keeps restarting .

    thread 'main' panicked at 'called Result::unwrap() on an Err value: ParseIntError { kind: InvalidDigit }', src/main.rs:295:79

    note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

    Screenshot_7

    image

    opened by LiamBica 2
  • Installation

    Installation

    Hi, Firstly, I really want to apologize for wrongfully opening an issue for this. I have looked how to message you privately for the last day or so but could not find anything of the sort.

    I've never used docker, and would love to host this bot. I have downloaded your latest binary and installed docker on a fresh VPS. However, I quickly figured out that I have no idea how to start up the bot. I'm in a directory with the binary and the docker-compose.yml with all the info filled in, and nothing I do seem to make it run.

    I also saw your Muse project, which looks great to host too and I probably will want to do that later as well!

    Thank you very much, again, I apologize for misusing this section but there wasn't much else for me to do.

    EDIT: After a bit of messing around, I see what I was missing. In case you need someone to write an updated wiki with how to run it, I would be more than happy to help considering I've just gone through it!

    opened by ryqm 1
  • Make the bot follow multiple users

    Make the bot follow multiple users

    Fixes https://github.com/codetheweb/aoede/issues/31

    • Added a bunch of upgrades as well

    Tested to be working just fine

    Required breaking change:

    DISCORD_USER_ID is now DISCORD_ADMINS which is a list

    For supplying via env vars, DISCORD_ADMINS = '["user1","user2"]'

    opened by baalajimaestro 1
  • Becomes unresponsive after first disconnection

    Becomes unresponsive after first disconnection

    Bot works fine when first joining a voice channel, it connects and plays as usual. But as soon it disconnects from a voice channel it never comes back, the following error is sent on console every time you join a new voice channel.

    Could not find user in VC.
    
    Jul 20 11:29:55.059 ERROR librespot_connect::spirc: AutoplayError: MercuryError    
    [...Same error multiple times]
    
    opened by nodgear 19
  • Aoede not appearing in Connect to a device

    Aoede not appearing in Connect to a device

    Using the latest prebuilt binary for Windows.

    Managed to run it two hours ago with no issues, got it connected to my server and played on Spotify. Trying to run it again now after closing my CMD window and turning off the PC. I get the message that everything is Ready, but no option is showing up in Spotify to connect to the device. Removed all variables in Regedit and set them again with the same issue.

    Searched through the Librespot issue tracker, but didn't find much that could help.

    I also received emails from Spotify the first three times I ran the exe regarding a new login, but running it now does not yield an email.

    Is there a way to fix this or am I better off running the source code?

    opened by JakePorter22 3
  • Make credentials optional if using on local network

    Make credentials optional if using on local network

    afaik it shoult be possible to use the bot with spotify webapi tokens -> it should be possible to implement oauth and offer the bot to more than one user without giving away login credentials

    enhancement good first issue 
    opened by cloudybyte 4
Releases(v0.6.0)
Owner
Max Isom
Student and developer. Likes starting side projects and occasionally finishes them.
Max Isom
MRVN is a Discord music player bot.

MRVN is a Discord music player bot. It has a few neat features: Supports a wide array of sites, including Youtube, Soundcloud, Twitch and many mo

Tom Barham 17 Jan 1, 2023
Polaris is a music streaming application, designed to let you enjoy your music collection from any computer or mobile device.

Polaris is a music streaming application, designed to let you enjoy your music collection from any computer or mobile device. Polaris works by streami

Antoine Gersant 1k Jan 9, 2023
Rust-crate with functions and helpers for working with music / audio, inspired by computer music languages.

music-math This crate contains common functions and helpers for working with music / audio in Rust. Most of these are inspired by similar functions fo

Mads Kjeldgaard 3 Apr 10, 2024
A music bot build in Serenity/Rust.

Sunny Flowers is a Discord bot to play media in voice channels. It uses Serenity and Songbird to accomplish this.

Sophie 11 Nov 5, 2022
A discord voice recorder bot

distream distreamは長時間の音声録音Botで、2時間以上の録音が可能です。 音声はwebmで保存され、ユーザーごとにトラックが分離されているので書き出す際にユーザーを選択できます。 how to use !join to join voice channel and start re

virtualCrypto 6 Sep 5, 2022
Spotify for the terminal written in Rust 🚀

Spotify TUI A Spotify client for the terminal written in Rust. The terminal in the demo above is using the Rigel theme. Spotify TUI Installation Homeb

Alexander Keliris 14.1k Jan 1, 2023
A spotify daemon

Spotifyd An open source Spotify client running as a UNIX daemon. Spotifyd streams music just like the official client, but is more lightweight and sup

null 8.4k Dec 31, 2022
Gtk/Rust native Spotify client for the GNOME desktop.

Gtk/Rust native Spotify client for the GNOME desktop.

Alexandre Trendel 1.7k Jan 1, 2023
A Spotify downloader written in rust, which does not require a premium account

DownOnSpot A Spotify downloader written in Rust Disclaimer DownOnSpot was not developed for piracy. It is meant to be used in compliance with DMCA, Se

oSumAtrIX 273 Jan 7, 2023
Psst - Fast and multi-platform Spotify client with native GUI

Psst Fast Spotify client with native GUI, without Electron, built in Rust. Very early in development, lacking in features, stability, and general user

Jan Pochyla 7.2k Jan 2, 2023
ncspot is a ncurses Spotify client written in Rust using librespot.

ncspot is a ncurses Spotify client written in Rust using librespot. It is heavily inspired by ncurses MPD clients, such as ncmpc. My motivation was to provide a simple and resource friendly alternative to the official client as well as to support platforms that currently don't have a Spotify client, such as the *BSDs.

Henrik Friedrichsen 3.4k Jan 8, 2023
code to connect + communicate with a Spotify Car Thing

spotify_carthing_bt A grab-bag of spotify car thing related hacks I'm working on. deskthing-rs A Rust port of https://github.com/relative/deskthing, w

Daniel Prilik 6 Dec 19, 2022
Effortlessly beautify your Spotify playlists with just a single, enchanting script 💫 🎵

harmonia harmonia, effortlessly beautify your Spotify playlists with just a single, enchanting script. ?? ?? HANDLE WITH LOVE: Since harmonia is bloss

Gülce 4 Jun 23, 2023
A command line application to organize Spotify playlists.

Sortify A command line application to organize Spotify playlists. Using Sortify, you can choose a playlist as the source playlist, and then have the o

Francisco Cunha 4 Aug 14, 2024
A music theory guide written in Rust.

Rust Music Theory A library and executable that provides programmatic implementation of the basis of the music theory. Table of Contents Overview Usag

Ozan Kaşıkçı 551 Dec 21, 2022
The open source musician's digital music stand

DiNoScore* A digital music stand written with GTK in Rust using WoAB. Includes an editor to import your sheet. Touch-friendly thanks to Libhandy. Ever

null 13 Dec 5, 2022
Your musical pokedex, Plex for music

Musidex Your musical pokedex, Plex for music. Add songs from youtube videos or youtube playlist to your library, or import them from your local files.

Pâris DOUADY 35 Oct 5, 2022
A next-generation music player and manager

ouverture A next-generation music player and manager Very much at Work-In-Planning stage now Planned features GUI (localizable) Backend (something lik

Michael B 9 Nov 17, 2022
Terminal Music Player written in Rust

Terminal Music Player written in Rust Listen to music freely as both in freedom and free of charge! Freedom: As time goes by, online service providers

null 376 Jan 3, 2023