Microphone input data - Page 1
Forum section: electronics / general

author: yalect
author_rank: Regular Contributor
timestamp: November 14, 2024, 12:50:34 pm
content: Hi,I would like to ask you if I can program or find a simple or small application(.exe)that can readthe Microphonedigital input datadirectllyand monitor it on label or display as decimal numbers?.thank you.

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 14, 2024, 12:53:34 pm
content: What OS (operating system) are you using?

author: yalect
author_rank: Regular Contributor
timestamp: November 14, 2024, 12:59:36 pm
content: Thank youwindows7, no problem if is there an application for andriod too?.

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 14, 2024, 02:20:51 pm
content: I would not know. I did post anexample for Linux and PulseAudioback in 2021, as getting audio data (microphone or line-in) in Linux is rather easy.Unfortunately, I don't currently have any other OSes or development environments installed on my workstations right now, and can only help with Linux development (having lots of experience there). (While Tux is my mascot, I'm not a zealot, and often help others with even proprietary stuff.)If Python is an option, usingpyAudioand thePortAudiov19 library, and the built-in Pythonwavemodule for uncompressed PCM.wavfiles, would work on basically all platforms, including Windows, for numerical/mathematical manipulation of audio data as arrays of numbers, PCM samples.Alternatively, if you could install both Python 3.8.20 (or 3.8.10) and Qt 5 (= PySide2) including QtMultimedia module, it would be easy to create a simple graphical cross-platform application to cater for your needs. The Python code is the same on all architectures, so I could help you with this.The latest Python version that supports Windows 7 is3.8.20, but there are no official binary installers for it (one would need to compile it from the sources). The last version with official installers for Windows 7 is3.8.10. After installing Python, you open Terminal, and run "pip install pyside2" (or "pip3 install pyside2") to install Qt5 support for Python.(In case you wonder, "PySide2" is the name of the official Python bindings to Qt 5. Another set of equivalent bindings is "PyQt5".)In other threads here, I've shown others how to use Python 3 and Qt 5 to create simple graphical interface tools. TheQt 5 APIis documented here, and it's quite straightforward and easy to implement – although it does have its pitfalls and downsides.If you want to manipulate the audio data numerically, you'll definitely also want to install SciPy ("pip install scipy") or NumPy, as they implement the math operations in native machine language operations (and thus do not suffer from Python being an interpreted language). Especially useful for doing FFTs and such. Note that one second of monophonic sound typically consists of 44100 or 48000 numbers between -32768 and +32767, inclusive (16-bit 44.1kHz or 48kHz sampling).Again, while I could show the Python code needed (as long as I understood a bit better what you are actually trying to achieve), I don't have Windows and cannot help much withinstallingPython itself on Windows.Also, I am unsure on how well Python 3 + Qt 5 work under WSL2. I do know of quite a few real-world differences between WSL2 and real Linux installations (Virtual Machines running Linuxdorun fine under Windows), but I just don't know if WSL2 would be a viable option here.

author: Postal2
author_rank: Frequent Contributor
timestamp: November 14, 2024, 06:21:29 pm
content: QuoteUse this program's buffer.

author: RoGeorge
author_rank: Super Contributor
timestamp: November 15, 2024, 09:09:57 am
content: Quote from: Postal2 on November 14, 2024, 06:21:29 pmAdd a delay of a few hundreds of milliseconds, then try to read out loud something while listening to the delayed audio.

author: Postal2
author_rank: Frequent Contributor
timestamp: November 15, 2024, 11:53:58 am
content: Quote from: RoGeorge on November 15, 2024, 09:09:57 amI haven't tried this program myself, but I also needed to read sound. Since I'm not a big expert in Windows multimedia, I tried to look for where I could copy-paste the code. I downloaded 2 versions of this program a long time ago, here is the second one.

author: RoGeorge
author_rank: Super Contributor
timestamp: November 15, 2024, 12:01:56 pm
content: If you add a delay and listen to your own voice in the headphones, you'll find hard to speak, you get a "speech jammer".https://duckduckgo.com/?t=ffab&q=speech+jammer&ia=web

author: gf
author_rank: Super Contributor
timestamp: November 15, 2024, 12:09:53 pm
content: Quote from: yalect on November 14, 2024, 12:50:34 pmWhat do you mean by "read the microphonedigitalinput datadirectly"?Does your microphone have a native digital interface such as PDM, I²S or S/PDIF?Or do you just mean reading PCM data from the soundcard (while the mic still has an analog connection to the sound card)?

author: Postal2
author_rank: Frequent Contributor
timestamp: November 15, 2024, 12:15:06 pm
content: Quote from: RoGeorge on November 15, 2024, 12:01:56 pmHowever, this is precisely the principle on which stuttering treatment devices operate.

author: newbrain
author_rank: Super Contributor
timestamp: December 11, 2024, 11:18:02 pm
content: Quote from: RoGeorge on November 15, 2024, 12:01:56 pmAlmost but not quite entirely, off-topic:That's exactly how the curse on radio and television works, cast by the preacher in "Of Godlike Powers" (Mack Reynolds, 1966).I read it when I was not yet ten, and remember being struck by the concept, but only got confirmation that the idea is actually sound (pun shamelessly intended) many years later.

author: SteveThackery
author_rank: Super Contributor
timestamp: December 14, 2024, 08:34:06 pm
content: Quote from: gf on November 15, 2024, 12:09:53 pmExactly what I was going to ask; this needs clarifying. The OP talks about showing the numerical data in a label or similar, but at 44,100 numerical samples per second it's going to be a bit of a blur.