Add stderr arg to create_ffmpeg_player
This commit is contained in:
parent
cd87f247d3
commit
e977bddc1f
@ -323,7 +323,7 @@ class VoiceClient:
|
|||||||
# Encrypt and return the data
|
# Encrypt and return the data
|
||||||
return header + box.encrypt(bytes(data), bytes(nonce)).ciphertext
|
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
|
"""Creates a stream player for ffmpeg that launches in a separate thread to play
|
||||||
audio.
|
audio.
|
||||||
|
|
||||||
@ -356,6 +356,9 @@ class VoiceClient:
|
|||||||
pipe : bool
|
pipe : bool
|
||||||
If true, denotes that ``filename`` parameter will be passed
|
If true, denotes that ``filename`` parameter will be passed
|
||||||
to the stdin of ffmpeg.
|
to the stdin of ffmpeg.
|
||||||
|
stderr
|
||||||
|
A file-like object or ``subprocess.PIPE`` to pass to the Popen
|
||||||
|
constructor.
|
||||||
options : str
|
options : str
|
||||||
Extra command line flags to pass to ``ffmpeg`` after the ``-i`` flag.
|
Extra command line flags to pass to ``ffmpeg`` after the ``-i`` flag.
|
||||||
before_options : str
|
before_options : str
|
||||||
@ -399,7 +402,7 @@ class VoiceClient:
|
|||||||
stdin = None if not pipe else filename
|
stdin = None if not pipe else filename
|
||||||
args = shlex.split(cmd)
|
args = shlex.split(cmd)
|
||||||
try:
|
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)
|
return ProcessPlayer(p, self, after)
|
||||||
except FileNotFoundError as e:
|
except FileNotFoundError as e:
|
||||||
raise ClientException('ffmpeg/avconv was not found in your PATH environment variable') from e
|
raise ClientException('ffmpeg/avconv was not found in your PATH environment variable') from e
|
||||||
|
Loading…
x
Reference in New Issue
Block a user