1

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?

  • 1
    It is possible that the MiBox microphone is only usable for certain MiBox functions, not for ordinary apps. Use `PackageManager` and `hasSystemFeature()` with `FEATURE_MICROPHONE` to see whether the MiBox advertises that it has a microphone. – CommonsWare Aug 19 '18 at 17:58
  • 1
    That's it... Seems that they disabled it on the last Oreo update :( Thank you very much I was getting mad with this. –  Aug 19 '18 at 19:35
  • @SergiBarjola : Any luck in recording audio in Android TV via controller's mic ? Any idea how to record audio from ATV's controller's mic? – Udayan Oct 25 '18 at 15:15
  • I haven't been successful so far... Sad :( –  Oct 25 '18 at 15:23
  • @SergiBarjola any update? I want to try audio input as well on Android TV !!! – Amirhossein Naghshzan Jan 23 '20 at 19:41
  • I got it tested on a Fire TV running Nougat and `MediaRecorder.AudioSource.VOICE_RECOGNITION` worked and actually recorded audio. DEFAULT and MIC did'nt work. And it also needs the mic button to be held. – hoshiKuzu Feb 13 '20 at 13:12

0 Answers0