From be40c0c1d805755f6fc576a6abc2bbd95b3fcf7a Mon Sep 17 00:00:00 2001 From: dariohy <85084942+dariohy@users.noreply.github.com> Date: Mon, 12 Jul 2021 11:58:58 -0500 Subject: [PATCH] Update audio.py For those of you who have a mono (1 channel) mic, the '-ac' flag should be entered strictly before the '-i device'; if that flag is set after the device declaration, then the setting will apply for the output (as per the man page for ffmepg command). Hope this helps. --- micstream/audio.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/micstream/audio.py b/micstream/audio.py index 50429c4..98ea50b 100644 --- a/micstream/audio.py +++ b/micstream/audio.py @@ -28,6 +28,18 @@ class AudioSource: '-b:a', str(bitrate) + 'k', '-ac', str(channels), '-ar', str(sample_rate), '-f', 'mp3', '-') +# For those of you who have a mono (1 channel) mic, the '-ac' flag should be entered strictly +# before the '-i device'; if that flag is set after the device declaration, then the setting +# will apply for the output (as per the man page for ffmepg command). Hope this helps. +# Ultimatelly, it will look like this: +# +# self.ffmpeg_args = ( +# ffmpeg_bin, '-f', audio_system, '-ac', '1', '-i', device, '-vn', '-acodec', 'libmp3lame', +# '-b:a', str(bitrate) + 'k', '-ac', str(channels), '-ar', str(sample_rate), +# '-f', 'mp3', '-') +# + + self._ffmpeg_start_time = None self._first_sample_time = None self.latency = 0.