Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Volcan on Tue 08/10/2013 17:02:01

Title: How to us CD audio (solved)
Post by: Volcan on Tue 08/10/2013 17:02:01
I try to include cd audio in my game.

Code (ags) Select
CDAudio(eCDIsDriverPresent, disque);

Disque is always set to zero even if a cd-audio is inserted.
Title: Re: How to us CD audio
Post by: Khris on Tue 08/10/2013 17:36:49
This is not how the function works. It RETURNS 0 or 1.

Code (ags) Select
  if (CDAudio(eCDIsDriverPresent, 0) == 1) Display("CD detected.");
Title: Re: How to us CD audio
Post by: Volcan on Tue 08/10/2013 18:26:35
Thanks for the fast answer.

No matter if a cd audio is inserted or not, your code tells the CD is detected.

I wonder if this code detects if a computer has a cd drive installed unstead if a cd-audio is insereted or not.

Code (ags) Select
function room_AfterFadeIn()
{
if (CDAudio(eCDIsDriverPresent, 0) == 1) Display("CD detected.");
mouse.Visible = true;
gGui1.Visible = true;
mouse.UseModeGraphic(eModePointer);
}
Title: Re: How to us CD audio
Post by: Crimson Wizard on Tue 08/10/2013 18:36:19
Quote from: Volcan on Tue 08/10/2013 18:26:35
No matter if a cd audio is inserted or not, your code tells the CD is detected.

I wonder if this code detects if a computer has a cd drive installed unstead if a cd-audio is insereted or not.

But this is all is in the manual:
Quote
eCDIsDriverPresent - checks if there is a CD-ROM driver available on
   the system
. Returns 1 if there is, and 0 if there is not.
Title: Re: How to us CD audio
Post by: Volcan on Tue 08/10/2013 18:51:04
I missed that. Thank you guys.

Now I'm back to work.