aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel <[email protected]>2016-07-08 14:48:04 -0400
committerDaniel <[email protected]>2016-07-08 14:48:04 -0400
commite977bddc1f909240b00548e837fefc058e7a832d (patch)
tree535678e2d3b355c8fe972dae35af930e491fb74e
parent[commands] Make Bot.check decorator an actual decorator. (diff)
downloaddiscord.py-e977bddc1f909240b00548e837fefc058e7a832d.tar.xz
discord.py-e977bddc1f909240b00548e837fefc058e7a832d.zip
Add stderr arg to create_ffmpeg_player
-rw-r--r--discord/voice_client.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/discord/voice_client.py b/discord/voice_client.py
index a92bf5b8..01826e21 100644
--- a/discord/voice_client.py
+++ b/discord/voice_client.py
@@ -323,7 +323,7 @@ class VoiceClient:
# Encrypt and return the data
return header + box.encrypt(bytes(data), bytes(nonce)).ciphertext
- def create_ffmpeg_player(self, filename, *, use_avconv=False, pipe=False, options=None, before_options=None, headers=None, after=None):
+ def create_ffmpeg_player(self, filename, *, use_avconv=False, pipe=False, stderr=None, options=None, before_options=None, headers=None, after=None):
"""Creates a stream player for ffmpeg that launches in a separate thread to play
audio.
@@ -356,6 +356,9 @@ class VoiceClient:
pipe : bool
If true, denotes that ``filename`` parameter will be passed
to the stdin of ffmpeg.
+ stderr
+ A file-like object or ``subprocess.PIPE`` to pass to the Popen
+ constructor.
options : str
Extra command line flags to pass to ``ffmpeg`` after the ``-i`` flag.
before_options : str
@@ -399,7 +402,7 @@ class VoiceClient:
stdin = None if not pipe else filename
args = shlex.split(cmd)
try:
- p = subprocess.Popen(args, stdin=stdin, stdout=subprocess.PIPE)
+ p = subprocess.Popen(args, stdin=stdin, stdout=subprocess.PIPE, stderr=stderr)
return ProcessPlayer(p, self, after)
except FileNotFoundError as e:
raise ClientException('ffmpeg/avconv was not found in your PATH environment variable') from e