Reputation: 1399
I want to learn how to process audio input in real time in Android, so I want to make an experimental app that do simple audio manipulation of a guitar connected to the Android device, implementing a simple overdrive effect just to learn.
I know that it's posible to capture audio using the AudioRecord class when using a normal audio input like the built in device mic, or using an TRRS 3.5mm Jack cable, but in most phones the latency is high, I suppose that some guitar tuners apps works in this way, but I'm wondering how AndRig, DrAmp and usbEffects apps works using an external usb guitar interface like the Behringer UCG102 to achieve a very low latency audio processing.
So, I want to use this usb guitar audio interface in my project to achieve low latency.
I searched for examples using this kind of guitar interfaces and I didn't find any tutorial or library to use it, so...
Do this Guitar to USB interface can be used like a normal input when connected to the device (So I can use the AudioRecord class like in a normal input)?
Do you know if exists some documentation or a tutorial to work with this kind of audio interfaces?
Or do I need to learn the Guitar to USB interface specific protocol and use low level USB API programming to do what I want?
Upvotes: 1
Views: 794
Reputation: 1834
The easiest way is probably buying this. There is also an API for android that looks a lot like LibUsb, you could try that to read the Usb endpoint as raw data (not sure if it would work out for your device though).
Another option is to make your own hardware (buy a microcontroller with a good ADC), and use [bulk transfers](https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#bulkTransfer(android.hardware.usb.UsbEndpoint, byte[], int, int)) (usb communication protocol for lots of data).
Upvotes: 1