Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   New sound function (https://forums.graalonline.com/forums/showthread.php?t=39051)

R0bin 10-09-2002 12:38 AM

New sound function
 
Function to get the length of a sound / music file in the memory.

E.g. Like imgwidth.. soundlength(soundfile)

play stef23.mid;
this.length=soundlength(stef23.mid);

Also a function to find the current position of the file.

currentsoundpos(stef23.mid);

or you could use indexes instead of the filename, but it would mean changing the play function to be more like showimg

play 56,stef23.mid;
if (currentsoundpos(56)>soundlength(56)-2000) {
fadeout();
}
function fadeout() {
for (i=1;i<-0.05;i-=0.05) {
setmusicvolume i,i;
}
}

the currentsoundpos return value would be in milliseconds, so would the sound length. hence the "-2000" part in my script, because 2000 milliseconds is 2 seconds :D

Com013 10-09-2002 12:50 AM

Nice, but what would you need it for?

R0bin 10-09-2002 01:31 AM

Uhhhhh... maybe playlists on music things..?

Crossfaders

Dach 10-09-2002 07:48 AM

That would be really cool. Alot better than putting the actual values for certain songs yourself, limiting the number of songs that would actually work.

R0bin 10-09-2002 02:06 PM

<3

G_yoshi 10-10-2002 09:25 AM

I suppose this idea would be nice if you wanted to create a music player with a GUI.

R0bin 10-10-2002 08:55 PM

Lol, is this the only future improvements thread that hasnt been flamed or what? ;)

Admins 10-13-2002 05:37 AM

Ok will add that for music that is currently played
(musicpos, musiclen)

R0bin 10-19-2002 10:57 PM

<3


All times are GMT +2. The time now is 12:23 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.