How to us CD audio (solved)

Started by Volcan, Tue 08/10/2013 17:02:01

Previous topic - Next topic

Volcan

I try to include cd audio in my game.

Code: ags
 CDAudio(eCDIsDriverPresent, disque);


Disque is always set to zero even if a cd-audio is inserted.

Khris

This is not how the function works. It RETURNS 0 or 1.

Code: ags
  if (CDAudio(eCDIsDriverPresent, 0) == 1) Display("CD detected.");

Volcan

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
function room_AfterFadeIn()
{
 if (CDAudio(eCDIsDriverPresent, 0) == 1) Display("CD detected.");
 mouse.Visible = true;
 gGui1.Visible = true;
 mouse.UseModeGraphic(eModePointer);
}

Crimson Wizard

#3
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.

Volcan

I missed that. Thank you guys.

Now I'm back to work.

SMF spam blocked by CleanTalk