bewantbe / audio-analyzer-for-android

A fork of audio-analyzer-for-android in Google code, with a lot of enhancement.
Apache License 2.0
285 stars 117 forks source link

How can I use raw PCM data directly as input? #26

Open staymillion opened 4 years ago

staymillion commented 4 years ago

I have an audio monitor hardware and I can get raw PCM data from it. How can I use the data as fft plot input? I'm checking the run() method in SamplingLoop.java file, is it the correct place that I can modify to use raw PCM data as input?

bewantbe commented 4 years ago

Yeah, that is the right place. Btw is that hardware run in an Android system?

staymillion commented 4 years ago

Yeah, that is the right place. Btw is that hardware run in an Android system?

Thank you very much, I got it and your code works very fine! No, our hardware is just a single integrated circuit board and it runs c program to collect audio signal, then encode them into PCM data and send to Android phone via UDP socket

fhaefele commented 1 year ago

I have a Patterson M500-384 ultrasound microphone that I connect to my Google Pixel 7 running Android 13. https://batsound.com/product/m500-384-usb-ultrasound-microphone/

I thought I can use the USB audio stream as input, but I see no option of doing so. It seems that the ADC in the phone itself is sampling the incoming audio stream again at the highest sampling rate of 192k which is obviously lower than the intended 384k. Do you know how I could stream the microphone data directly into the app?

bewantbe commented 1 year ago

Hi fhaefele, may be try look up the menu (settings->audio source), and try different source. If nothing worked, then the code might need some change.