Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Need Help With CD Audio

Author
Message
Celtic Powers
19
Years of Service
User Offline
Joined: 22nd Jun 2007
Location:
Posted: 30th Jun 2007 15:02
Hi everyone..
I'm new to Darkbasic and I've been trying to make a simple program to play audio cd's in. It works fine when run through Darkbasic, but when I try to make an executable it doesn't work.
If anyone has any suggestions or knows that what I want to do isn't possible, your help would be appreciated.

Here's My Code If It Helps...



Uisce Beatha tagann tapa dhuitt!
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Jun 2007 21:44
@ Celtic Powers

There's a much better way to check your keystate() than multiple IF statements. You could use a SELECT CASE statement:


But seeing as your are making a CD player, you want the number of tracks to be variable so that you can play any CD you want.
You could make two extra buttons for "Previous Track" and "Next Track" and then have a variable called "track" that gets altered by clicking the buttons.

I haven't used the CD commands for ages so I'll have a look and come back to you on this one

Advice: If you seem to be writing the same thing over and over again, there's probably a better way of doing it. Check the help file on SELECT CASE they can be really useful but I couldn't work out what they did for a long time lol

I make music and art. Here is a sample of my art: done in Paint! It's all I have
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 1st Jul 2007 04:27
@Celtic Powers

I can't use the LOAD CDMUSIC command under any circumstances. I'm guessing it has something to do with having a dvd drive and a cd drive . What I found is that I can load the track directly as music:

CD <to your cd drive letter>

load music "track01.cda",1
play music 1

But if you want this to be generic so anyone can use it, you have to be able to identify which drive is the cd drive. Now if you have DBC enhanced, there's a method using the win api to identify the drive, if not, it's a little harder to identify the drive type in DBC.

A generic method I came up with to detect if there is a cd in a drive follows. This will only work if the CD doesn't contain a Data track (programs and folders) - because the .cda won't be found.



Enjoy your day.
Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 1st Jul 2007 04:46
I have a tutorial on Select and Case at TGPF, TDK's programming forums.

Did someone say 3D scanning on my desk, or was that just an AdBot?
What happens when when you mix coke, pop rocks, vinegar, and baking soda?

Login to post a reply

Server time is: 2026-07-05 18:17:09
Your offset time is: 2026-07-05 18:17:09