How to find the type of the CD

Hi Friends,

   Can some one guide me to find whether the inserted CD is an audio or video or data cd.

  If the CD is an audio CD, then how to play the audio files.

  Thanks for your guidance.

Shiva

shiva@indusaglobal.com
nsivatgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chensuCommented:
Some CD-ROMs may also contain audio tracks. To detect if there is any audio track, try opening the cdaudio device. See

Playing a Compact Disc Track
http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/psdk/multimed/mci_45d7.htm


Use MCI or MCIWnd window class to play audio CDs.

MCIWnd Window Class
http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/psdk/multimed/mciwnd_5uer.htm

MCI
http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/psdk/multimed/mci_7vvt.htm

A Cd-audio class to build a simple CD player
http://www.codeguru.com/multimedia/cd_audio.shtml
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nsivatgAuthor Commented:
Still, How do I check whether the CD inserted is a audio or a data CD?

Any suggestions.

Thank you

Shiva
0
chensuCommented:
Try GetVolumeInformation. This function may fail with an audio CD.
0
nsivatgAuthor Commented:
But is there a facility in Win API to find the type of CD which could be audio or video or data etc.,

Similar to GetDriveType() API.

Thanks for your ideas.

GetVolumeInformation may return an error if the CD is unformatted which might pose a problem to us. So, how do we overcome this error?


Siva
0
chensuCommented:
>But is there a facility in Win API to find the type of CD which could be audio or video or data etc.,

No.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.