Author Topic: Microphone input data  (Read 771 times)

0 Members and 1 Guest are viewing this topic.

Offline yalectTopic starter

  • Regular Contributor
  • *
  • Posts: 144
Microphone input data
« on: November 14, 2024, 12:50:34 pm »
Hi,
I would like to ask you if I can program or find a simple or small application (.exe) that can read the Microphone digital input data directlly and monitor it on label or display as decimal numbers?.

  thank you.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7140
  • Country: fi
    • My home page and email address
Re: Microphone input data
« Reply #1 on: November 14, 2024, 12:53:34 pm »
What OS (operating system) are you using?
 

Offline yalectTopic starter

  • Regular Contributor
  • *
  • Posts: 144
Re: Microphone input data
« Reply #2 on: November 14, 2024, 12:59:36 pm »
Thank you
windows7, no problem if is there an application for andriod too?.
 
The following users thanked this post: Smokey

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7140
  • Country: fi
    • My home page and email address
Re: Microphone input data
« Reply #3 on: November 14, 2024, 02:20:51 pm »
I would not know.  I did post an example for Linux and PulseAudio back 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, using pyAudio and the PortAudio v19 library, and the built-in Python wave module for uncompressed PCM .wav files, 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 is 3.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 is 3.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.  The Qt 5 API is 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 with installing Python 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 Linux do run fine under Windows), but I just don't know if WSL2 would be a viable option here.
 

Offline Postal2

  • Frequent Contributor
  • **
  • Posts: 802
  • Country: 00
Re: Microphone input data
« Reply #4 on: November 14, 2024, 06:21:29 pm »
Quote
"Repeater" is a program for those who want to hear their voice in real time. The main task of the program is to redirect the sound stream from the microphone to the computer speakers.

Use this program's buffer.
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6972
  • Country: ro
Re: Microphone input data
« Reply #5 on: November 15, 2024, 09:09:57 am »
Quote
"Repeater" is a program for those who want to hear their voice in real time. The main task of the program is to redirect the sound stream from the microphone to the computer speakers.

Use this program's buffer.

Add a delay of a few hundreds of milliseconds, then try to read out loud something while listening to the delayed audio.  ;D

Offline Postal2

  • Frequent Contributor
  • **
  • Posts: 802
  • Country: 00
Re: Microphone input data
« Reply #6 on: November 15, 2024, 11:53:58 am »
Add a delay of a few hundreds of milliseconds, then try to read out loud something while listening to the delayed audio.  ;D
I 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.
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6972
  • Country: ro
Re: Microphone input data
« Reply #7 on: November 15, 2024, 12:01:56 pm »
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

Online gf

  • Super Contributor
  • ***
  • Posts: 1410
  • Country: de
Re: Microphone input data
« Reply #8 on: November 15, 2024, 12:09:53 pm »
Hi,
I would like to ask you if I can program or find a simple or small application (.exe) that can read the Microphone digital input data directlly and monitor it on label or display as decimal numbers?.

  thank you.

What do you mean by "read the microphone digital input data directly"?
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)?
 

Offline Postal2

  • Frequent Contributor
  • **
  • Posts: 802
  • Country: 00
Re: Microphone input data
« Reply #9 on: November 15, 2024, 12:15:06 pm »
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
However, this is precisely the principle on which stuttering treatment devices operate.
 
The following users thanked this post: RoGeorge

Online newbrain

  • Super Contributor
  • ***
  • Posts: 1800
  • Country: se
Re: Microphone input data
« Reply #10 on: December 11, 2024, 11:18:02 pm »
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
Almost 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.
Nandemo wa shiranai wa yo, shitteru koto dake.
 
The following users thanked this post: RoGeorge

Offline SteveThackery

  • Frequent Contributor
  • **
  • Posts: 786
  • Country: gb
Re: Microphone input data
« Reply #11 on: December 14, 2024, 08:34:06 pm »
What do you mean by "read the microphone digital input data directly"?
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)?

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


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf