Browse Source

Insert options before pipe:1 in ffmpeg player, otherwise they are ignored

pull/66/head
Khazhismel 9 years ago
parent
commit
e8a06b7ee9
  1. 5
      discord/voice_client.py

5
discord/voice_client.py

@ -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…
Cancel
Save