A GetDriveType() Windows API függvénnyel először megállapítható, hogy a vizsgált meghajtó CD-ROM
meghajtó-e, majd a GetVolumeInformation() Windows API függvénnyel pedig megvizsgálhatjuk,
hogy a 'VolumeName' értéke 'Audio CD'-e vagy sem.

uses MPlayer;

...

function IsAudioCD(Drive : char) : bool;
var
   DrivePath : string;
   MaximumComponentLength : DWORD;
   FileSystemFlags : DWORD;
   VolumeName : string;
begin
   Result := false;
   DrivePath := Drive + ':\';
   if GetDriveType(PChar(DrivePath)) <> DRIVE_CDROM then exit;
   SetLength(VolumeName, 64);
   GetVolumeInformation(PChar(DrivePath), PChar(VolumeName), Length(VolumeName), nil, MaximumComponentLength, FileSystemFlags, nil, 0);
   if lStrCmp(PChar(VolumeName),'Audio CD') = 0 then result := true;
end;

function PlayAudioCD(Drive : char) : bool;
var
   mp : TMediaPlayer;
begin
   result := false;
   Application.ProcessMessages;
   if not IsAudioCD(Drive) then exit;
   mp := TMediaPlayer.Create(nil);
   mp.Visible := false;
   mp.Parent := Application.MainForm;
   mp.Shareable := true;
   mp.DeviceType := dtCDAudio;
   mp.FileName := Drive + ':';
   mp.Shareable := true;
   mp.Open;
   Application.ProcessMessages;
   mp.Play;
   Application.ProcessMessages;
   mp.Close;
   Application.ProcessMessages;
   mp.free;
   result := true;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
   if not PlayAudioCD('D') then
   ShowMessage('Not an Audio CD');
end;