Read AirPlay Audio Device Type (HomePod, Apple TV, etc)

42 Views Asked by At

I am trying to get info about a connected AirPlay device using

    let currentRoute = AVAudioSession.sharedInstance().currentRoute
    
    guard let output = currentRoute.outputs.first else {
        return
    }

When connected to HomePod or Apple TV, I can get the output.portType which is .airplay and the output.portName which is just "AirPlay". I would love to get the type of device my app is connected to.

I've tried using the output.uid but HomePods don't seem to follow any discernable pattern as compared to other AirPlay devices.

It seems very strange that I would not be able to see the type of device connected, or at least the name. I'm starting to suspect that this isn't possible, but I just wanted to make sure there are no other frameworks or ideas anyone else has.

0

There are 0 best solutions below