Skip to content

When i change input to BluetoothHFP, player is not working.  #167

@anjaeyoung26

Description

@anjaeyoung26
let options: AVAudioSession.CategoryOptions = [.mixWithOthers, .allowBluetoothA2DP, .allowBluetooth]
            
try session.setCategory(.playAndRecord, mode: .default, options: options)
try session.setActive(true)
            
if let inputs = session.availableInputs {
    for input in inputs {
        if input.portType == .bluetoothHFP {
            do {
                try session.setPreferredInput(input)
            } catch {
                print(error)
            }
        }
    }
}

I set audio session's input to BluetoothHFP for playing and recording music with Bluetooth mic.
After changing the input, there is no sound even after restarting the player.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions