I've been developing a software that uses the "AudioRecord" class for getting microphone input and afterwards it processes it to detect X frequencies on the sound.
Example:
AudioRecord recorder = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, SAMPLE_RATE, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, AUX);
recorder.startRecording();
It works with an AsyncTask, recording as a back process. I'm also using the following permissions:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
And I'm granting them correctly on my Android TV device.
I've been testing it on the Android Studio emulator and on a few phones and it works flawless, but when I try to use the APP on my Android TV (MiBox HD) it almost doesn't capture audio, it doesn't detects anything most of the time and only works by a few seconds after trying many times.
I know that the microphone on the Android TV is usually on the pad or controller so I'm not sure if I am missing something.
What I'm doing wrong? I'am missing something?