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 Professional Discussion / Help with creating media player

Author
Message
Ultimate
22
Years of Service
User Offline
Joined: 1st Nov 2003
Location:
Posted: 20th Nov 2003 22:48
I am trying to create a media player. Since DBPro use load sound for .wav and load music for .mp3 and .mid, I am having trouble creating a way to load both via the same method. I load in the file's location as a string file$. Is there anyway I can analyse the string such that I can read off the last 3 letters and get the file type? Any help would be appreciated.

In a world without leaders, who'd start all the wars?
Shadow Lord
22
Years of Service
User Offline
Joined: 26th Sep 2003
Location:
Posted: 21st Nov 2003 00:16
Quote: "anyway I can analyse the string such that I can read off the last 3 letters"


Try this:

ext$=right$(song$,3)

Song$=your sound filename, eg, "Jump.MP3"
ext$ will be equal to the last 3 characters in the filename. eg, "MP3"

Look in the help file for the RIGHT$ command, for more info...

I'm using DBPro to write "Suger Free Candyland", for diabetic children!
Shadow Lord
22
Years of Service
User Offline
Joined: 26th Sep 2003
Location:
Posted: 21st Nov 2003 00:19
However, DBPro doesn't if a music file is ".mid" or ".MP3". The same commands will play them both.

A ".WAV" file is a sound file, and not a music file, per say. You must use the SOUND command to load and play them.

Hope this helps, if not let me know.

I'm using DBPro to write "Suger Free Candyland", for diabetic children!

Login to post a reply

Server time is: 2026-07-26 20:17:47
Your offset time is: 2026-07-26 20:17:47