Android.Media.AudioManager.StartBluetoothSco Method
Start bluetooth SCO audio connection.

Syntax

[Android.Runtime.Register("startBluetoothSco", "()V", "GetStartBluetoothScoHandler")]
public virtual void StartBluetoothSco ()

See Also

AudioManager.StopBluetoothSco
AudioManager.ActionScoAudioStateUpdated

Remarks

Start bluetooth SCO audio connection.

Requires Permission: NoType:android/Manifest$permission;Href=../../../reference/android/Manifest.permission.html#MODIFY_AUDIO_SETTINGS.

This method can be used by applications wanting to send and received audio to/from a bluetooth SCO headset while the phone is not in call.

As the SCO connection establishment can take several seconds, applications should not rely on the connection to be available when the method returns but instead register to receive the intent AudioManager.ActionScoAudioStateUpdated and wait for the state to be AudioManager.ScoAudioStateConnected.

As the ACTION_SCO_AUDIO_STATE_UPDATED intent is sticky, the application can check the SCO audio state before calling startBluetoothSco() by reading the intent returned by the receiver registration. If the state is already CONNECTED, no state change will be received via the intent after calling startBluetoothSco(). It is however useful to call startBluetoothSco() so that the connection stays active in case the current initiator stops the connection.

Unless the connection is already active as described above, the state will always transition from DISCONNECTED to CONNECTING and then either to CONNECTED if the connection succeeds or back to DISCONNECTED if the connection fails (e.g no headset is connected).

When finished with the SCO connection or if the establishment fails, the application must call AudioManager.StopBluetoothSco to clear the request and turn down the bluetooth connection.

Even if a SCO connection is established, the following restrictions apply on audio output streams so that they can be routed to SCO headset:

The following restrictions apply on input streams:

  • the format must be mono
  • the sampling must be 8kHz

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.

NOTE: up to and including API version NoType:android/os/Build$VERSION_CODES;Href=../../../reference/android/os/Build.VERSION_CODES.html#JELLY_BEAN_MR1, this method initiates a virtual voice call to the bluetooth headset. After API version NoType:android/os/Build$VERSION_CODES;Href=../../../reference/android/os/Build.VERSION_CODES.html#JELLY_BEAN_MR2 only a raw SCO audio connection is established.

[Android Documentation]

Requirements

Namespace: Android.Media
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 8