Automatic Gain Control in Python?

Steve GS Gronicus at SGA.Ninja
Sat May 28 20:17:02 EDT 2022


"My first thought is you are solving the wrong problem. What seems a better
option would be to get your code to actually connect up to the podcast and
just download the audio directly, rather than trying to get the smart
speaker to play the audio and record it with a microphone."

The smart-speaker is bringing in the podcast by hourly automated commands
and sending by audio cable to a computer which is recording it with
Audacity.  This is an automated system that runs for 48 hours every weekend.
Its output is played live throughout the facility and is also recorded for
replay through the week.

No download to use.

AGC is to happen when the Smart Speaker is playing it, real time.
Any post-record editing would be a horrendous task to say the least.

=============================

Genie: You have three wishes.
Me: I wish I had more wishes.
Genie: You cannot wish for more wishes.
Me: I wish I could.

-----Original Message-----
From: Python-list <python-list-bounces+gronicus=sga.ninja at python.org> On
Behalf Of Richard Damon
Sent: Saturday, May 28, 2022 6:53 PM
To: python-list at python.org
Subject: Re: Automatic Gain Control in Python?

On 5/28/22 5:29 PM, Steve GS wrote:
> I have an extensive Excel/VBA program that hourly calls and plays 
> podcasts through a "smart" speaker. The output of the speaker feeds 
> into another computer that records the m\audio using Audacity.
>
> It has become obvious that NPR does not regulate volumes for podcasts 
> and broadcasts nor are programs in themselves regulated by volume.  
> Audacity does not have an AGC.
>
> It has also been noted that Excel/VBA code cannot see the audio being 
> played on the same computer.
>
> I would like to find code that will regulate the volume and give some 
> semblance of control/moderation. Also, sometimes the Smart Speaker 
> fails to play the program and I get an hour of silence before the next 
> command to play happens. The code should detect that nothing is 
> playing and send the command to the smart speaker again.
>
> Is there any Python code that I might be able to call from VBA that 
> will monitor and regulate the volume of the audio? A few samples of 
> code that can read/modify the audio will help me develop the final
product.
>
> Suggestions appreciated.

My first thought is you are solving the wrong problem. What seems a better
option would be to get your code to actually connect up to the podcast and
just download the audio directly, rather than trying to get the smart
speaker to play the audio and record it with a microphone. That might
require finding the API for the site that hosts the podcasts, to get it to
send the files to you to "play".

Once you have the files, it becomes simple signal processing to go over the
files and AGCing them as needed.

On a side note, make sure you are within your rights within Copyright law
for what you are doing. Recording for PERSONAL use is probably within the
bounds of "Fair Use", but the material is surely under Copyright, so be
careful what you do with it.

--
Richard Damon

--
https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list