getsongpos/setsongpos
Displaying 1-5 of 5 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Technetium

Whenever I use getsongpos, and then test the value using log, it comes out to 0 about 60% of the time, and 2 the remaining 40%. I never comes out equal to anything else. When I try to use setsongpos, it either starts the song at the beginning or it doesn't play anything at all. Has anyone managed to get these functions to work?

Posted on 2004-07-28 22:30:33

vecna

On mods, getsongpos returns the order number. Those numbers could very well be valid, depending on the mod.

For an mp3 it returns bytes.

Posted on 2004-07-29 00:10:03

RageCage

I havent done extensive testing but I havent been able to get them to work on my stuff. I havent tried mp3s though. sounds like that might actually work

Posted on 2004-07-29 01:49:59

Technetium

Quote:Originally posted by vecna

On mods, getsongpos returns the order number. Those numbers could very well be valid, depending on the mod.

For an mp3 it returns bytes.

I'm using mods. The thing is, I have it use getsongpos at one point, and store it in a variable. The song it grabs the position of is played using playsong, not playmusic (I think it has to be that way). Then I log the variable to check it (it comes out as 0 or 2). Then I switch to another map, and play a different song using playmusic instead (since that song will never be played anywhere other than from the start). Then I stop that music, go back to the previous map, tell it to play the loaded song (which is still loaded; I never did anything to free it) using playsong again, and I immediately use setsongpos to the variable I set it to before. When I do this, it either plays from the very start, or it plays complete silence.

This is for the map music, to battle, to map again, incidentally.

Posted on 2004-07-29 03:37:52

KingOfTheNorth

.ogg returns bytes

Position be seen by using

PrintString(0,0,screen,fontname,str(GetSongPos(songname)));


For a song that has 100 000 bytes, it will start counting from 0 and stop at 100 000 bytes when the song is done playing.

You need to SetSongPos(bytenumber) in that case.

Posted on 2010-08-07 03:39:26


Displaying 1-5 of 5 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.