Type Property

bluetoothLE

Output to a Bluetooth Low Energy (LE) peripheral.

Declaration

static let bluetoothLE: AVAudioSession.Port

Discussion

Apple supports the use of Bluetooth Low Energy (LE) hearing aids. Apps don’t have control over routing to these devices. Instead, the system automatically decides when routing to Bluetooth LE is appropriate.

To determine if audio is currently routed to a Bluetooth LE device, inspect the current audio route and look for the presence of a Bluetooth LE port, as shown in the following code example.

var routingToBLE = false
let session = AVAudioSession.sharedInstance()
// Iterate over the currentRoute's outputs.
for portDesc in session.currentRoute.outputs where portDesc.portType == .bluetoothLE {
    routingToBLE = true
    break
}