How can I analyze sound output in Python? - python

Is it possible to get the system output audio (the exact same thing that goes through the speakers) and analyze it in real time with Python? My intention is to build a sound visualizer. I know that it is possible to access the microphone with pyaudio, but I was not able to access the sound card output in any way, I'm looking for a solution that works on Windows.
Thank you for reading.

Not sure how this project is doing these days, it's been a long time since it's been updated. PyVST allows you to run python code in a VST inside a VST host, which makes it possible to handle realtime audio events.
You might want to look at http://code.google.com/p/pyo/ for some ideas about how to handle DSP data as well.

Related

Building a virtual microphone using Electron?

I'm trying to build a virtual microphone that takes the physical microphone's input stream, modifies the audio using a neural network model written with Python, and replaces the sound stream with my program's output sound stream (in near realtime) so that other apps (e.g. Zoom, Skype, etc.) will receive my app's modified audio stream, for both Mac and Windows.
I've been reading for the last few hours and so far found several libraries that might (?) be able to work here: WebRTC, Soundflower, etc. Does anyone know if there's already a good library that can do or facilitate this? This might be wading into offtopic territory, but if this is doable entirely in Python, e.g. through eel or similar, does anyone know of any library that can do the same type of audio manipulation?
Thank you!
You can create virtual microphone device using official Core Audio APIs

Sound Decibel Output Python

I have tried using soundmeter for this specific issue, however, did not really find a way to do it so. I want to get the current PC microphone input, and as an output to get the Decibel of the sound that is recorded by my integrated microphone. Any other libraries that you can suggest? Searched a lot, but did not really find something useful.

How to read a tag from PN532 in Python?

I want to experiment with the PN532 that comes connected with an arduino UNO. I have never touched anything similar, and in fact it took me quite a few tries to be able to play with LEDs on another arduino board I have.
Can someone provide me with a concrete example of reading data from the pn532 when I use a tag or card on it in Python?
Take a look at https://github.com/HubCityLabs/py532lib. The standard library is in C, somebody wrote a Python wrapper for the C library that you can use.
I did found a way that might be partially correct. Since Eugenes' answer does not provide a definitive way that we know will work, it cannot be considered a full answer so I will most probably accept this one if nothing else changes.
First of all since the PN532 does not continuously monitor for signals and emits data, we will have to program it the usual way in order for it to behave according to what we want to achieve.
This can be done using the same software that you program any other Arduino device.
Make sure you have chosen the correct port from the tools menu. If you don't know which port is that, in windows go to Start>All Programs>Accessories>System Tools>System Information>Components>Ports>Serial. For Linux going to /dev/serial/by-id should do.
Then I would recommend using the examples provided by the manufacturer here. Make sure you choose the right connection type or else you will see no data coming from the device (Most probably you will want I2C).
Once that is done, and your device emits data each time a tag is used on it (check with a serial terminal configured at 115200 Baud rate) then you are ready to start working with python.
Again I recommend this module to read your data from the serial port. It even comes with a ready to use example of a wxWidgets terminal to read your data from the PN532. If of curse you use another python library and you think its better do say so in the comments.

Python Intercepting/reading audio output level in python/linux

I'm trying to write something that catches the audio being played to the speakers/headphones/soundcard and see whether it is playing and what the longest silence is. This is to test an application that is being executed and to see if it stops playing audio after a certain point, as such i don't actually need to really know what the audio itself is, just whether or not there is audio playing.
I need this to be fully programmatic (so not requiring the use of GUI tools or the like, to set up an environment). I know applications like projectM do this, I just can't for the life of me find anything anywhere that denotes how.
An audio level meter would also work for this, as would ossiliscope data or the like, really would take any recommendation.
Here is a very similar question: record output sound in python
You could try to route your output to a new device with jack and record this with portaudio. There are Python Bindings for portaudio called pyaudio and for jack called PyJack. I have never used the latter one but pyaudio works great.

Cross-platform audio import from different sources

I am using Python, and I want to analyze audio files from internet streaming media (for example Youtube, Soundcloud, etc.)
Is there a universal way to do so? There is a pre-loading for every music or video, there must be a way to access it? How?
I want to run this script on an external server, that might be relevant to the answer.
Thanks
All sound you "hear" on your pc has to run through your soundcard, Maybe somehow write a script that "records" the sounds runnning through the device. Maybe u can use Pymedia module?

Categories

Resources