Creating a Discord audio bot for D&D soundboards with iOS app control?

Hey everyone,

I’m working on a cool D&D project and need some advice. I’ve got this mobile soundboard app for tabletop games, but now I want to make it work with Discord. Here’s what I’m thinking:

  1. Make a Discord bot that can hop into voice channels
  2. Let it play multiple sounds at once (like background music and sound effects)
  3. Control it from my iOS app in real-time
  4. Stream audio files from Firebase
  5. Add or remove sounds on the fly
  6. Maybe even adjust volume for each sound

Is this doable? I’m not sure where to start. The idea is to have the app work as a remote control for the Discord bot. Players could tap buttons in the app to trigger sounds in their Discord game.

Has anyone tried something like this before? Any tips or libraries I should look into? I’m pretty new to Discord bots, so any advice would be awesome.

Thanks a bunch!

I’ve actually implemented something similar for my own D&D group, so I can share some insights. The Discord.js library is indeed your best bet for the bot itself - it’s robust and well-maintained. For audio handling, I found discord-player to be a godsend. It simplifies a lot of the audio stream management headaches.

For the iOS control, I ended up using Socket.IO to establish a real-time connection between the app and a Node.js server. This server then communicates with the Discord bot. It worked smoothly, allowing for near-instantaneous sound triggering.

One challenge I faced was latency when streaming from Firebase. I ended up pre-caching commonly used sounds on the bot’s host machine to mitigate this. For less frequent sounds, I still stream from Firebase, but there’s a noticeable delay.

Multi-sound mixing was tricky. I implemented a basic mixing system using the Web Audio API, but it’s not perfect. Still, it gets the job done for most D&D scenarios.

Hope this helps! Feel free to reach out if you need more specific advice.

Creating a Discord audio bot with iOS app control for D&D soundboards is definitely achievable. I’ve worked on similar projects before, and here’s what I’d recommend:

Start by using the Discord.js library for your bot. It’s well-documented and has good support for voice channels. For audio playback, look into FFmpeg - it’s great for handling multiple audio streams simultaneously.

To connect your iOS app, you’ll need to set up a backend server (Node.js works well) that can communicate with both the Discord bot and your app. WebSockets are perfect for real-time control.

For audio streaming from Firebase, you can use their Storage SDK. Just make sure to optimize your audio files for quick loading.

The trickiest part might be managing multiple audio streams with individual volume control. You’ll need to dive into some lower-level audio processing for that.

Good luck with your project! It sounds like it’ll be a fantastic addition to your D&D sessions.

hey, seems like a rad idea. discord.js is great for the bot and firebase realtime database works well for syncing your app controls. just be cautious of rate limits. i tried something similar a while back—hoping this helps out. good luck with your proj!