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.
This commit is contained in:
dariohy 2021-07-12 11:58:58 -05:00 committed by GitHub
parent 4420740c66
commit be40c0c1d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.