From fedf26bf3e91e12a403144e8282300a785c204d4 Mon Sep 17 00:00:00 2001 From: Imayhaveborkedit Date: Sat, 22 Jun 2019 02:33:53 -0400 Subject: Add FFmpegOpusAudio and other voice improvements Rework FFmpeg player and add FFmpegOpusAudio I have extracted some of the base FFmpeg source code into its own base class and reimplemented the PCM and the new Opus variants. Support avconv probing Also fix a few things Update `__all__` Fix the bugs Rework probe functions and add factory function Probing involves subprocess so it has been reworked into an async factory function. Add docs + a few tweaks * Removed unnecessary read() and is_opus() functions from FFmpegAudio * Clear self._stdout in cleanup() * Add 20 second process communication timeout to probe functions * Capped probe function bitrate values at 512 Change AudioPlayer to use more accurate, monotonic time.perf_counter() Add lazy opus loading The library now no longer loads libopus on import, only on opus.Encoder creation or manually. Fix review nits --- docs/api.rst | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/api.rst b/docs/api.rst index 6516a14a..b86ef02c 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -60,9 +60,15 @@ Voice .. autoclass:: PCMAudio :members: +.. autoclass:: FFmpegAudio + :members: + .. autoclass:: FFmpegPCMAudio :members: +.. autoclass:: FFmpegOpusAudio + :members: + .. autoclass:: PCMVolumeTransformer :members: -- cgit v1.2.3