importing sound/music

Could anyone help me with the syntax on how to import sound/music into my program? I know how to create sound using the computers internal speakers. One of my friends, however, said there was a way to change the type of music file and import it into the program. If anyone could help I'd be greatly appreciative!

Comments

RE: sound/music

Thank you very much for your input! Could you show me an example of the syntax to chain out to the player, such as iTunes. I might be able to work it into my program somehow. :-)

re:sound/music

The manual leaves out the fact that the first character after CHAIN needs to be "!". The subroutine below chains out to a REALPLAYER to show a file vidname$. The defdir$ is the location of the real player file, player$ is the actual player file name.

For example
LET defdir$ = "C:\Program Files\Real\RealPlayer\"
LET player$ = "realplay.exe"
The rest of the command and the ASK DIRECTORY statements are so that the Chain command can find the file no matter where a user might place the main program and data files. [The "&" symbol appears strange (on my computer) in this forum, but is the ampersand.]

SUB SHOWVIDEO(vidname$)
ASK DIRECTORY dir$
CHAIN "!"&defdir$&player$&" file://"&dir$&"\videos\"&vidname$&".RM",RETURN
END SUB

re: importing sound/musics

This is one of the major weak spots in True Basic. To my knowledge, the only way to do this is to write an external suproutine in some language (C, C++) that supports the music and then try and figure out how to bind it into your true basic program. This is not at all easy (been there, tried it with help, and still didn't get something that worked properly). You can CHAIN out to a player--I do that to chain to a video player in some programs, but that will not play music WHILE your true basic program is operating. You might get music to play over a title screen this way, but fundamentally True Basic does not support sound and music (other than simple sounds through the internal speaker).

rwt