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 / getting the current position in playing music?

Author
Message
dvocha
23
Years of Service
User Offline
Joined: 15th Jul 2003
Location:
Posted: 3rd Dec 2003 17:22
Is there a way to tell (with as high a degree of accuracy as possible) how far into a playing music object the program currently is?

I've tried reading the value of timer() right when the music starts and then checking timer() to tell how much time has elapsed but if the system gets lagged for a second then this no longer works since the elapsed time is no longer the time into the music object being played.

Thanks.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 3rd Dec 2003 18:21
Someone was working on a media addon .Dll that gives more control over MP3's and sounds, like forward, rewind, track time, all the stuff I'd love to see in DBPro. I like messing with sound in DBPro (I wrote the first and only DBPro soundtracker) so the lack of control over sound is a real pain.

I suppose you could look into the .OGG player .dll, .ogg is a licence fee free alternative to .MP3's, but it needs an external .dll - pretty sure you can find a DBPro example. The thing is that the ogg .dll might be smoother, or might have some extra features that you might find helpfull, the lack of a licensing fee makes it a nice option too.


Van-B


I laugh in the face of fate!
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 3rd Dec 2003 18:33
The only way I'd do it is take the value tom timer() when the music starts and work out how many milliseconds ahve been played.

The get the length of a sound, use this code:



"Help! My keyboard is stuckkkkkkkkkkkkkkkkkkkkkkkkkkkkk"

Mercenaries in Space demo @ http://www.davidtattersall.me.uk
dvocha
23
Years of Service
User Offline
Joined: 15th Jul 2003
Location:
Posted: 3rd Dec 2003 19:01
Yeah, unfortunetly counting elapsed system time doesn't work because if there's some lag everything's off.

I did find this site though: http://nagoya.cool.ne.jp/oryaaaaa/DBP_H012.htm

15 minutes and I had working, synced (ogg) audio in dbpro(trial version), including the time it took to find an ogg encoder, decode a mp3 to wav, and re-encode it to ogg

The english on the page is a bit sketchy but I believe it's ok to use. If someone who's looked at licensing things in the least could check the top bit of the page out and tell me your opinion on the wording, I'd be in your debt. If it's ok to use it's a great and simple way to get that extra smidge of functionality in there.
Shadow Lord
22
Years of Service
User Offline
Joined: 26th Sep 2003
Location:
Posted: 3rd Dec 2003 21:34
check the top bit of the page out and tell me your opinion on the wording
Quote: "This DLL can be freely for no-charge distributed with use."


I think your safe to redistribute, he just wants his due credit in your readme.txt

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

Login to post a reply

Server time is: 2026-07-26 20:16:58
Your offset time is: 2026-07-26 20:16:58