Is there a way to measure audio output level in Python? I'd like to measure the volume of a 30 second audio file every 1/10th of a second, then export the data into something like Excel. Is this possible?
Asked
Active
Viewed 893 times
1
-
Are you trying to measure the volume of an audio file, or the volume of what's currently going out the hardware audio port, or something else? – Russell Borogove Jun 29 '12 at 22:48
-
@RussellBorogove The method that seems most likely to be possible to me would be the volume of what's going out the hardware port. I could either use that method or, for what I'm doing, use a microphone's input. – Reece McMillin Jun 30 '12 at 03:52
-
1Unfortunately, listening to the output port is deliberately made non-easy in modern operating systems for DRM reasons. Listening to input is straightforward; here's a recipe (using portaudio/pyaudio) for detecting taps on a microphone: http://stackoverflow.com/questions/4160175/detect-tap-with-pyaudio-from-live-mic/4160733#4160733 – Russell Borogove Jul 01 '12 at 00:35
-
But you mention an audio _file_. This should be easier than monitoring either the input or output ports. – alexis Jul 01 '12 at 17:43
-
Russell Borogove has a good direction with pyaudio, but I have never used it before. I think I will do some of my own reading on the material. – Rusty Weber Jul 03 '12 at 17:28
1 Answers
0
I know that this is a long shot, but maybe there are some libavcodec/FFMpeg ports to python. It's always worth a shot to see if there is something that exists out there along these lines...

Rusty Weber
- 1,541
- 1
- 19
- 32
-
1Looking for a [wrapped native] library doesn't sound like a "long shot" at all.. just have to find such suitable library. Of course this question, as it is, leaves too little to go on and, without specifics, this is more of a comment.. – Jun 29 '12 at 22:25
-
"...maybe there are some libavcodec/FFMpeg ports to python"? This is nowhere near an answer. – Joel Cornett Jun 29 '12 at 22:26
-
It may not be an exact answer, but going in the direction of a wrapped library would provide the answer needed to the question at hand. In this case "py-audio" seems to be the weapon of choice for wrapped codec functions and Uber props to Russell Borogove for knowing the libraries existed. – Rusty Weber Jul 03 '12 at 17:25