I would like to capture the audio from a specific channel (eg. I have a 3.5mm headset and a Bluetooth headset both connected to an android phone. Right now, it receives audio from both sources when I use "AudioSource.MIC" and I would like to capture an audio from a bluetooth headset only) is there anyway I can specify the audio channel programatically ?
How can I programmatically capture audio from a specific channel on Android?
My device is the Nexus One, running Android 2.3.7, Bluetooth headset Jabra BT 2035
Related
Trying to make a simple application,in which after connecting android phone to bluetooth headset,when we press volume buttons on headset device it must change volume of android device.
So basically trying to control android device volume using bluetooth headsets.
Is there any way to do this ?
TIA
I am developing an Android app which have to use both the smartphone's inbuilt mic and a bluetooth headset mic. I want to add a radio button in my app, so that users can freely choose to use either the inbuilt mic or the bluetooth headset mic.
When a user choose bluetooth headset mic, the bluetooth headset mic should simulate the inbuilt mic, that is, the bluetooth headset mic exactly replaces the inbuilt mic.
How to implement it?
I have solved my own question!
The answer is AudioManager
After my bluetooth headset has connected to my smart phone. There is just two steps to do:
Step one:
mAudioManager.startBluetoothSco();
Step two:
mAudioManager.setBluetoothScoOn(true);
Then my headset bluetooth's mic is working!
I'm new in android development, I'm developing a simple application that plays a music on button click through speaker , I would like to know how to route an audio to A2DP bluetooth device after paring with the A2DP device.
What are the configurations of AudioManager and other presets?
Thanks!
If I set AudioManager mode to MODE_IN_COMMUNICATION, and set the Media Player stream to STREAM_VOICE_CALL, I can route the audio to the speakerphone or the internal handset speaker just fine. And if it's routed to the internal speaker, and a wired headset is plugged int, it automatically routes to it. However, I can't figure out a way to route the audio to an A2DP headset (without changing the audio mode to MODE_NORMAL, or the stream to STREAM_MUSIC). My problem is that using MODE_NORMAL and STREAM_VOICE_CALL causes problems on some devices, and using STREAM_MUSIC is a problem if there is already music playing in the background, then my app "mixes" with that background music.
So, I was hoping that there was a way to force the audio to the A2DP headset using the MODE_IN_COMMUNICATION and STREAM_VOICE_CALL combination. Is that possible?
Perhaps it works on some devices, but if you care about compatibility across the majority of devices then the answer is "No".
When the phone state is MODE_IN_CALL or MODE_IN_COMMUNICATION all streams will typically follow the PHONE routing strategy. This means that routing to A2DP will not be allowed since:
1) A2DP doesn't support two-way voice anyway.
2) If your BT accessory supports the Hands-free profile it will use a SCO link for the voice audio, and the ACL channel used for A2DP should be closed to avoid interference between the two.
I'm using my Nexus One with Android 2.2 Froyo in my car dock. For the audio output I'm using a a2dp receiver which is hooked up to my car stereo.
Now, when I put the phone in the car dock it automatically connects to the car dock but not to my a2dp receiver, I have connect it manually in the settings (already paired).
I'm also using a custom app for audio playback. I thougt I maybe could force the a2dp connection to the a2dp receiver. But as far as I know, the default Bluetooth API does not support such a thing.
Is there any Intent for establishing the connection, or any other way? I would also accept an undocumented solution.
I fixed this recently with the app A2DP volume.
My issue was my lg p920 on android 2.3.5 would connect to handsfree and a2dp stereo audio with my Sony car stereo mex bt3950ou (many other brands have the same issue).
Once the car was turned off and back on again ie. in turning the ignition from acc to start, the connection would be lost and only the handsfree would reconnect.
A2DP volume can be configured to force reconnect the stereo audio connection, see instructions on the A2DP volume site.
See your issue with twin BT devices. You can get BT Visor mount systems that do this. The BB version will stream A2DP music from the device AND allow you to take calls. The drawback is it uses FM to get the sound to your headunit so sound quality will be lower than native BT.
The technique is demonstrated in this app: http://code.google.com/p/a2dpvolume/A2DP Volume
Look at service.java and the IADL file.