Using USB sound input for an android game – is it possible?

| | August 4, 2015

We are brainstorming ideas for an app, for a major project using Android Studio, and writing in java. My major is game development, so I intend on trying to build a video game based off the use of an electric guitar, as input.

While I can set up a means to provide input via the audio-in, through the 3.5mm, having USB input would be far more effective.

My main question is: Is it feasible?

To give background, I believe it must be entirely possible, however, I am unsure how difficult the process would be.

I am basing my question off three things.

  1. If I plug my Xbox controller directly into my phone, it automatically works. So the requirement for local support does not work as strictly as I understood it too.

  2. If I plug the Rocksmith cable into a computer, and tell my sound card to “listen” to it, the guitar automatically comes through the speakers as if I was using the computer as an amplifier. This implies that no software is required on the computer side to interpret the input.

  3. If you set up the electric guitar to connect to the computer via the microphone, it is not only compatible with Rocksmith, but it works just as well. This tells me the USB cable does not do anything fancy, in order to interpret the guitar – it must all be software side.

To start me off, all I really need to do is be able to interpret the frequencies. If I run into brick walls, further on, I will simply build around it, or change my games scope.

In terms of accessibility, I do understand the repercussions of requiring the Rocksmith cable to run the game. However, at the moment, simple being able to use the Rocksmith cable allows me to work on the part I am being marked on. If it goes to plan, I can access a more accessible means to use USB, later.

For those that are not familiar with Rocksmith, for the purpose of this question, it is simply a game that includes an electric guitar to USB cable, and is able to assess the player as they play the guitar, by reading its frequencies to determine what notes are being hit.

One Response to “Using USB sound input for an android game – is it possible?”

  1. 3.5mm support would probably be easier if you want something to work out of the box by default.

    Android is a very mature platform at this point and it has plenty of other applications besides just a Phone operating system. The OS has a fairly well documented USB api: https://developer.android.com/guide/topics/connectivity/usb/index.html which can probably be used to get the USB functionality you want. However this may not work out of the box, I honestly couldn’t tell you which devices do and do not work out of the box. If you want to end up interpreting frequencies from a device over USB you may end up having to write some sort of driver or wrapper.

    Note that you may want or need to use a USB OTG cable or adapter to go from micro USB to full USB.

Leave a Reply