Nick Meyer
Nick Meyer

Reputation: 40272

How to determine if the inserted CD is an Audio CD?

With GetLogicalDrives and GetDriveType, I can enumerate all the CD-ROM drives on my Windows machine.

How can I then tell which of them contain Audio CDs (as opposed to Data CDs or DVDs)?

Upvotes: 3

Views: 1194

Answers (1)

Moo-Juice
Moo-Juice

Reputation: 38825

Maybe this can help:

http://www.codeproject.com/KB/audio-video/SimpleAudioCD.aspx

The data stored on CDs is determined in sectors. A "normal" CD-sector takes 2048 bytes (2KB) of size. Something special about audio-CDs is, that their audio-data is stored in sectors of 2352 bytes of size. That is because one sector should store 1/75 of one second of audio-data. One second needs 176400 bytes, so 1/75 needs 2352 bytes.

That implies, to me at least, that if the sector-size is 2352, it's an audio CD. But as Eugene says in his comment, what if it is both? NFI. :)

Upvotes: 1

Related Questions