Minor bug with SeekMusic

Report any Hollywood bugs here
Post Reply
Bugala
Posts: 1407
Joined: Sun Feb 14, 2010 7:11 pm

Minor bug with SeekMusic

Post by Bugala »

I am currently making an entro, and trying to time things right.

To avoid needing to watch the whole thing from beginning, I am using SeekMusic to jump to a certain location in the Music, and then timing is based upon using: GetAttribute(#MUSIC, 5, #ATTRPOSITION)

I have only one SeekMusic in the whole program, and it is like this:

Code: Select all

SeekMusic(5, 225000)
For some reason, it sometimes randomly keeps jumping to wrong location, seems to be at bit earlier location than it should.

Sometimes (very rare) it also seems to affect the GetAttribute command, since somehow while the music goes at normal speed, animation seems to slow down to half or something, which I suspect is that when using GetAttribute #MUSIC #ATTRPOSITION, it somehow moves the position index slower than it should.

And this behavior is not affected by changes in code, since sometimes, even without changing anything in the code, it one time works right, next time not.

I would say this problem occurs about once every 5-10 times.

Program is large, so it could be that something is colliding somewhere somehow, as in, something else causes this command to bug.

Just letting you know about this in case you take a look at the command. The problem is minor, so just reporting about it.

Windows 11, Hollywood 11.
Bugala
Posts: 1407
Joined: Sun Feb 14, 2010 7:11 pm

Re: Minor bug with SeekMusic

Post by Bugala »

Just took a try with this:

Code: Select all

OpenMusic(5, "sfx/musicfile.mp3")
PlayMusic(5)
SeekMusic(5, 225000)
WaitLeftMouse()
And bug doesnt happen.
Bugala
Posts: 1407
Joined: Sun Feb 14, 2010 7:11 pm

Re: Minor bug with SeekMusic

Post by Bugala »

Actually, I just took that SeekMusic line off from my program, and noticed that timings I have done are all off.

It appears it is actually the other way around. It is systematically jumping to wrong location, and only randomly jumps to, I assume, right location, since my animations are happening too late, and randomly it jumped to earlier spot, so it might be the right spot actually.
Bugala
Posts: 1407
Joined: Sun Feb 14, 2010 7:11 pm

Re: Minor bug with SeekMusic

Post by Bugala »

Actually, This isnt such a minor after all. Here is what I tried:

First I did:

Code: Select all

OpenMusic(5, "musicfile.mp3")
PlayMusic(5)
SeekMusic(5, 124800)
I kept changing the Seekmusic location number to find easily recognisable spot, which in this case was 124800.

Then I did following:

Code: Select all

OpenMusic(5, "sfx/musicfile.mp3")
PlayMusic(5)
Local time
Repeat
time = GetAttribute(#MUSIC, 5, #ATTRPOSITION)
If time > 124800 Then DebugPrint("location reached")
Forever
And this Debugprint happened several seconds after the easily recognisable location actually played.

It seems SeekMusic and GetAttribute #MUSIC #ATTRPOSITION, are offsync towards each other.

I assume this is not supposed to be so.
Post Reply