mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 16:00:29 +00:00
Insert options before pipe:1 in ffmpeg player, otherwise they are ignored
This commit is contained in:
parent
483384595b
commit
e8a06b7ee9
@ -386,12 +386,14 @@ class VoiceClient:
|
||||
"""
|
||||
command = 'ffmpeg' if not use_avconv else 'avconv'
|
||||
input_name = '-' if pipe else shlex.quote(filename)
|
||||
cmd = command + ' -i {} -f s16le -ar {} -ac {} -loglevel warning pipe:1'
|
||||
cmd = command + ' -i {} -f s16le -ar {} -ac {} -loglevel warning'
|
||||
cmd = cmd.format(input_name, self.encoder.sampling_rate, self.encoder.channels)
|
||||
|
||||
if isinstance(options, str):
|
||||
cmd = cmd + ' ' + options
|
||||
|
||||
cmd += ' pipe:1'
|
||||
|
||||
stdin = None if not pipe else filename
|
||||
args = shlex.split(cmd)
|
||||
try:
|
||||
@ -567,4 +569,3 @@ class VoiceClient:
|
||||
packet = self._get_voice_packet(encoded_data)
|
||||
sent = self.socket.sendto(packet, (self.endpoint_ip, self.voice_port))
|
||||
self.checked_add('timestamp', self.encoder.samples_per_frame, 4294967295)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user