Page 1 of 1
Posted: Wed Jun 12, 2002 3:18 pm
by BackupUser
Restored from previous forum. Originally posted by Tron.
Hey Everyone,
Does anyone know how to loop an MP3 with the PlayMovie(1, WindowID()) command?
I want to play an MP3 continuously, just like the PlaySound(1, 1) command allows you to loop a WAV file.
I tried using the MovieStatus() function, but it doesn't seem to respond the way I thought it would.
Does anyone have a good example for this?
Thanks,
Tron
"Honesty is the best policy, but insanity is a much better defense."
Posted: Wed Jun 12, 2002 4:25 pm
by BackupUser
Restored from previous forum. Originally posted by Paul.
If MovieStatus()=0
PlayMovie(1,WindowID())
EndIf
Works here

Posted: Wed Jun 12, 2002 9:52 pm
by BackupUser
Restored from previous forum. Originally posted by Tron.
If MovieStatus()=0
PlayMovie(1,WindowID())
EndIf
Hi Paul,
Thanks for the input!
Can you try my code and see if you can get the MovieStatus()=0 function to work in a loop with ScreenID() ? I think I am doing something wrong, or does this code work on your PC?
My code snippet:
;-----------------------------------------------------------------
If InitMovie() = 0
MessageRequester("Error", "Can't initialize Music playback.", 0)
End
EndIf
If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
MessageRequester("Error", "Can't open DirectX 7 or later.", 0)
End
EndIf
If OpenScreen(640, 480, 32, "Test")
LoadMovie(1, "test1.mp3")
Repeat
FlipBuffers()
ClearScreen(0,0,0)
If MovieStatus() = 0
PlayMovie(1, ScreenID())
EndIf
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
Else
MessageRequester("Error", "Can't open a 640*480 - 32 bit screen !", 0)
EndIf
End
"Honesty is the best policy, but insanity is a much better defense."
Posted: Thu Jun 13, 2002 12:45 am
by BackupUser
Restored from previous forum. Originally posted by Paul.
Hi Tron,
I cut and pasted your code exact and it works fine with the MP3's that I have. As soon as they finish they start again. (I'm using Win2K)
Posted: Thu Jun 13, 2002 3:55 am
by BackupUser
Restored from previous forum. Originally posted by Tron.
I cut and pasted your code exact and it works fine with the MP3's that I have. As soon as they finish they start again. (I'm using Win2K)
I am using Windows ME, and this same exact code will not not start playing on my machine. I even tried several different MP3's from different sources. I can only get it to play if I move the MovieStatus()=0... code outside of my repeat loop. This is very strange. I will try to test on my work machine which is W2K, and see if it works like your machine does. This is very strange.
"Honesty is the best policy, but insanity is a much better defense."