How to detect an audio cd?

I’m making an audio cd-player for osx (to be compact, non bloated, have gapless playing, correct de-emphais detection and filtering etc)…

If I can’t read directly from /dev/disk or /dev/rdisk I need to find out which volume(number) is an audio cd…

Using the terminal command: I can easily find out which disk that contains CD_DA tracks. (for example /dev/disk3)

Preferably I would like to read directly from disk with disk or rdisk. Each song is in this case represented in: disk3sX (X=the number of the song).
-Is there a way of reading from disk3s or rdisk3s in Xojo directly without messing with the user or admin password (if it even possible with password)?
I need it to start playing quickly, so I need the data in portions of each file.
I tried using DD and copying portions to a file to disk (could be a virtual disk), but it needs a password and it feels like a completely stupid workaround…

So, I am now exploring reading directly from the folder created on the desktop with .aiff files representation of the cd tracks (+aiff header). The problem with this (except other programs possibly messing with the cd drive, making reading difficult, incl OSX updating the graphics if the window i opened, is that the name of that folder changes when changing cd.

I tried setting the path to the cd using Volumes, but I can not use to find out which volume the cd is, since the disk/rdisk number does not match the Volume number and listing the volumes in the terminal does not include the same things as listing the volumes using volume() n Xojo.

Is there a fixed alias to the first or last audio cd mounted or some easy way to get info in what kind of data the volume holds, that makes it easy to identify which one is an audio cd? I can list the volumes, but have not a clue by the name what kind of a thing they are.
If I right klick->show info of the audio-cd desktop folder, the info says that it is an audio cd. -So the system knows. Something like Volume().info would be nice…

Or do I have to open each and all volumes and check the content in order to GUESS by the content which one is an audio cd?

I discovered that there is a hidden file .TOC file in the desktop folder representing the Audio Cd. Looking for that one and finding it together with “X” track.aiff I can be pretty sure that it is the Audio cd folder.

Still, I would be happier to play from /dev/disk or /dev/rdisk, so if anyone knows how to do that… Please…