Qbasicnews.com

Full Version: I could use some help here.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Can anyone tell me how to open other applications (such as winamp) through qbasic coding? It would be really great because I have a bunch of songs that I want winamp to play as backgroung music to this mini game that I am making.

Anonymous

well. i don't think you can *interface* with winamp, but what you CAN do, is, if winamp is associated with say, mp3 files, you could do


Code:
SHELL "start mp3youwannaplay.mp3"
Hmmm.. its not working.

I typed in
SHELL "start C:\Documents and Settings\Julie\Desktop\Ben's Folder\mjyah.mp3"

and that didn't work so I tried...
SHELL "start mjyah.mp3"

both gave me the same error message of "Bad command or file name."
Why?
"Start".... you don't need it do you?

Anyway SHELL just executes another program and doesn't retain anything from your previous program... also, why would you want to have other programs open specifically to play music, and also have your main program there too? You wouldn't be able to close the other program too.

What you're looking for is an MP3 player in Qbasic, which may or may not exist, but if it does, it is going to use interrupts to execute code that isn't really pure Qbasic...

Anonymous

i did a small amount of research about it back when QB was the only horse in town.

Bottom line is, slowwww ;p. Please, just try FB and tell us what you think of it. you can then use FMOD, BASS, etc. the "real" libraries.
SHELL "start C:\Documents and Settings\Julie\Desktop\Ben's Folder\mjyah.mp3"

Qbasic is a 16 bit DOS program, it can't have spaces in the names of files or folders. (Documents and Settings)
Quote:Can anyone tell me how to open other applications (such as winamp) through qbasic coding? It would be really great because I have a bunch of songs that I want winamp to play as backgroung music to this mini game that I am making.
If nothing else works, your game could display a list of suggested tunes for the user to hum. LOL :wink:
And I don't think a DOS shell will associate mp3 files with Winamp - you'd need to do something like.
Code:
SHELL "c:\winamp\winamp.exe -mjyah.mp3"
Even that is bad practice. Use a QB sound lib or go to FB.

[EDIT]I just tried trying to start an mp3 by simple typing the filename at the prompt, but I'm in XP. If you are using 95/98 it may be different.

Anonymous

I just tested it. My mehtod works in QB on Windows ME. The file you "start" has to have an associated application (i.e. if you double clicked it, what would hapen? winamp? Then start will run winamp.)

If you need to use a long path/filename, do this:

Code:
SHELL "start " + CHR$(34) + "c:\doc\music\dkc-08.spc" + CHR$(34)

Of course, changing to the path/file you need.
Quote:Can anyone tell me how to open other applications (such as winamp) through qbasic coding? It would be really great because I have a bunch of songs that I want winamp to play as backgroung music to this mini game that I am making.
Winamp SDK (http://winamp.com/nsdn/winamp/sdk) headers need to be SWIG'd and you can provide the functionality you want in FreeBASIC. I'm not familiar with any sound libraries for QB, but I would try using one of those rather than relying on Winamp [through a shell, no less]. You're going to have more control over your audio if you use a dedicated library. Plus, using Winamp forces everyone who wants to play your game to have Winamp installed as well. Not very nice. :wink:
Pages: 1 2