From 315a95750e19b3afc5cd16ed69d8bd5ef6c97b98 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Fri, 12 Feb 2021 10:51:34 +0200 Subject: [PATCH] [scripts/discord-stream-desktop-audio] allow specifying the audio device --- scripts/discord-stream-desktop-audio | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/discord-stream-desktop-audio b/scripts/discord-stream-desktop-audio index 603e5a4..e80d176 100755 --- a/scripts/discord-stream-desktop-audio +++ b/scripts/discord-stream-desktop-audio @@ -6,6 +6,7 @@ import os guild_id = int(sys.argv[1]) voice_channel_id = int(sys.argv[2]) +pulseaudio_device = sys.argv[3] with open(os.path.expanduser("~/.config/dotfiles/discord-tools-bot-token.txt")) as f: bot_token = f.read().strip() @@ -28,7 +29,7 @@ async def on_ready(): voice_client = await voice_channel.connect() print("connected to {0} ({0.id}) in {1} ({1.id})".format(voice_channel, guild)) - source = discord.FFmpegPCMAudio("default", before_options="-f pulse") + source = discord.FFmpegPCMAudio(pulseaudio_device, before_options="-f pulse") voice_client.play( source, after=lambda e: print("Player error: %s" % e) if e else None )