mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 16:00:29 +00:00
Close ffmpeg process after stream is finished.
This commit is contained in:
parent
da5d7581ee
commit
3ca5845566
@ -349,7 +349,12 @@ class VoiceClient:
|
||||
except Exception as e:
|
||||
raise ClientException('Popen failed: {0.__name__} {1}'.format(type(e), str(e)))
|
||||
|
||||
return StreamPlayer(process.stdout, self.encoder, self._connected, self.play_audio, after)
|
||||
def killer():
|
||||
process.kill()
|
||||
if callable(after):
|
||||
after()
|
||||
|
||||
return StreamPlayer(process.stdout, self.encoder, self._connected, self.play_audio, killer)
|
||||
|
||||
def encoder_options(self, *, sample_rate, channels=2):
|
||||
"""Sets the encoder options for the OpusEncoder.
|
||||
|
Loading…
x
Reference in New Issue
Block a user