Android Capture USB Mic Audio without root

My Android app is for non-Samsung Galaxy Note 2 phones running Android 4.4.2.

When my USB microphone is connected to the phone, it displays as / dev / snd / pcmC 1D0c, so I know that it is recognized as a sound recorder.

Is there a way to capture audio from this device into my application without rooting Galaxy Note 2?

  • I tried AudioRecord with all the parameters of MediaRecorder.AudioSource , and they all use the phone’s internal microphone.
  • I did not find in the settings / sound options for changing the input device.
  • I researched the Samsung Professional Audio SDK and it looked very promising until I found that the Galaxy Note 2 device I am aiming for is not supported by this SDK.

If you don’t have access to it with Java, can you use your own c-code (JNI) to access the existing tinyALSA driver and capture audio without using a phone?

I know that I can use libusb to directly capture audio packets, but I was hoping for a cleaner / easier way, since the phone already recognizes my audio input device.

+5
source share

Source: https://habr.com/ru/post/1207087/


All Articles