So the answer, at least for Lollipop, seems to be to use AudioSource.VOICE_COMMUNICATION instead of AudioSource.MIC, which is what is used on earlier versions.
On Thursday, February 26, 2015 at 9:24:07 AM UTC-5, Digipom wrote: > > I've been having some issues with startBluetoothSco() on my Nexus 5 on > Android Lollipop 5.0.1, where startBluetoothSco() will work and my > broadcast receiver will be called with an intent indicating that a > Bluetooth mic is connected, but when a recording is started, the audio is > recorded from the device's main input mic rather than the Bluetooth mic. > This issue is also reproducible on the Nexus 7 and may affect other devices > running 5.0.1 as well. > > Here is some example test code: > > http://pastebin.com/aEbEUhfy > > Does anyone know why this is happening? The same code works fine on > earlier versions of Android, and I can record from the Bluetooth mic there. > On 5.0.1, I still get an intent indicating that the mic is connected, but > the device will record from the on-device mic rather than the Bluetooth mic. > > The sample code requires these permissions in the manifest: > > <uses-permission android:name="android.permission.RECORD_AUDIO" /> > <uses-permission android:name="android.permission.BLUETOOTH" /> > <uses-permission > android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> > <uses-permission android:name="android.permission.BROADCAST_STICKY" /> > > The layout needs one button with android:id="@+id/recordStopButton". > > I also opened up this bug report: > https://code.google.com/p/android/issues/detail?id=156264 > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.