Friday, September 2, 2011

[android-developers] startBluetoothSco() not interrupted by incoming call

I've managed to get text-to-speech audio streaming through my SCO
headset using startBluetoothSco(), but it's not interrupted by
incoming phone calls, as documented at
http://developer.android.com/reference/android/media/AudioManager.html:

"Note that the phone application always has the priority on the usage
of the SCO connection for telephony. If this method is called while
the phone is in call it will be ignored. Similarly, if a call is
received or sent while an application is using the SCO connection, the
connection will be lost for the application and NOT returned
automatically when the call ends."

When a call comes in, I can hear both the phone call audio and my text-
to-speech audio at the same time. Has anyone successfully gotten the
correct behavior with incoming phone calls? I'm testing on a Samsung
Captivate running Android 2.2. Also, it's going through the
TextToSpeech class speak() method, if that makes a difference.

Thanks!

Rob

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

1 comment:

  1. you can regesiter for the android.intent.action.PHONE_STATE intent, and then check if TelephonyManager.EXTRA_STATE is TelephonyManager.EXTRA_STATE_OFFHOOK, at which point you can stop your TTS stream.

    ReplyDelete