2

I want to make a soundboard program for my friends and myself with a few meme sounds we find funny. I already have a working base with one button, that plays the desired sound. Now I just need to figure out a way how to make the audio play through my microphone (simulate microphone input). I already searched the internet and didn't find the exact solution I was looking for.

Here is the code I already have:

import tkinter as tk
import pygame

root = tk.Tk()
root.title("Soundboard");
root.geometry("720x480");

pygame.mixer.init()

def play():
    pygame.mixer.music.load("sound.mp3")
    pygame.mixer.music.play(loops=0)

play = tk.Button(root, text="Play", font=("Arial", 18), command=play)
play.pack(pady=20)

root.mainloop();

TweeZed
  • 55
  • 1
  • 8
  • You probably need to create a virtual microphone device and play through that. – Sumner Evans Jan 19 '21 at 17:59
  • Does this answer your question? [Playing mp3 file through microphone with python](https://stackoverflow.com/questions/37055745/playing-mp3-file-through-microphone-with-python) – Random Davis Jan 19 '21 at 18:01
  • @RandomDavis well not really. This is really broad explanation. I was hoping for a bit more detailed explanation possibly with some code snippets provided. – TweeZed Jan 19 '21 at 18:20
  • @TweeZed have you looked into external software, like Virtual Audio Cable? https://vb-audio.com/Cable/ – Random Davis Jan 19 '21 at 18:23
  • @RandomDavis Yes I have but I'd like the program to be all in one, if possible. Just run the program, click one of the sound buttons and that's all. If I have to install any additional software it kinda loses it's purpose, because in that case I can use something like Voicemod. – TweeZed Jan 20 '21 at 07:56
  • @TweeZed it sounds like you'd have to get into low level audio drivers and such, or utilize ctypes and Windows DLLs to be able to possibly do that. If it's on another platform it'd be a totally different solution, and I wouldn't even know where to start if it wasn't on Windows. It just doesn't seem like there'd be an easy solution out there if there isn't already one written by someone who did all the work and research to make it happen. – Random Davis Jan 20 '21 at 16:08
  • @RandomDavis Ok, I get it. I'll just try to find an app that suits my purpose the best and close the question. Thank you for your comments! – TweeZed Jan 21 '21 at 18:20

0 Answers0