Code: Select all
InitMovie()
LoadMovie(0,"sound.mid")
PlayMovie(0,WindowID())
Code: Select all
InitMovie()
LoadMovie(0,"sound.mid")
PlayMovie(0,WindowID())
Code: Select all
Procedure LoadSpecialSound(Number,SoundFile$)
InitMovie()
If LoadMovie(Number,SoundFile$) = 0
MessageRequester("Error","Failed to load the special sound: "+SoundFile$+". Please make sure the sound file is Mp3 or MIDI")
EndIf
EndProcedure
Procedure PlaySpecialSound(Number)
If PlayMovie(Number, WindowID()) = 0
MessageRequester("Error","Failed to play the special sound: "+Str(Number)+". Please make sure the sound file is Mp3 or MIDI")
EndIf
EndProcedure
LoadSpecialSound(1,"sound.mid")
PlaySpecialSound(1)
Repeat
If MovieStatus()=0 ; Check if sound is no longer playing
PlayMovie(1,WindowID())
EndIf
ForEver
Code: Select all
Procedure LoadSpecialSound(Number,SoundFile$)
InitMovie()
If LoadMovie(Number,SoundFile$) = 0
MessageRequester("Error","Failed to load the special sound: "+SoundFile$+". Please make sure the sound file is Mp3 or MIDI")
EndIf
EndProcedure
Procedure PlaySpecialSound(Number)
If PlayMovie(Number, WindowID()) = 0
MessageRequester("Error","Failed to play the special sound: "+Str(Number)+". Please make sure the sound file is Mp3 or MIDI")
EndIf
EndProcedure
If OpenWindow(0, 0, 0, 40, 0, #PB_Window_SystemMenu, "...")
LoadSpecialSound(1,"G:\C2notzip\MUSIC\Brainpower - Wat Een Jinx Is.mp3")
PlaySpecialSound(1)
Repeat
If MovieStatus()=0 ; Check if sound is no longer playing
PlayMovie(1, WindowID())
EndIf
Delay(1)
Until WindowEvent() = #PB_Event_CloseWindow
EndIf
This would work, but if you have the music in a game, it would make the game have a 0.5fps issue.Try....
PlaySpecialSound(1)
Delay(2000)
Repeat
There's some timing issue going on...... The movie doesn't start before you query it..... so it starts again..... then the same thing happens again
I have abandoned the movie commands for now until they are fixed.... NOT quite true, but the principle is there
Ok. I have tried this, but it will only play/repeat the sound if I move the window it creates. Nice try though.Code:
Procedure LoadSpecialSound(Number,SoundFile$)
InitMovie()
If LoadMovie(Number,SoundFile$) = 0
MessageRequester("Error","Failed to load the special sound: "+SoundFile$+". Please make sure the sound file is Mp3 or MIDI")
EndIf
EndProcedure
Procedure PlaySpecialSound(Number)
If PlayMovie(Number, WindowID()) = 0
MessageRequester("Error","Failed to play the special sound: "+Str(Number)+". Please make sure the sound file is Mp3 or MIDI")
EndIf
EndProcedure
If OpenWindow(0, 0, 0, 40, 0, #PB_Window_SystemMenu, "...")
LoadSpecialSound(1,"G:\C2notzip\MUSIC\Brainpower - Wat Een Jinx Is.mp3")
PlaySpecialSound(1)
Repeat
If MovieStatus()=0 ; Check if sound is no longer playing
PlayMovie(1, WindowID())
EndIf
Delay(1)
Until WindowEvent() = #PB_Event_CloseWindow
EndIf
This works.
Code: Select all
length = [that long is the movie in millisecs]
start = gettickcount_()
playmovie()
Repeat
IF gettickcount_() > start + length
stopmovie()
playmovie()
Endif
until something
I have a couple of questions: 1-What is that interesting looking gettickcount_() command, what does it return? 2-How can I find out what the length of my movie is?If you would know, how long your movie is (... the movielength()-command works only with real movies, not with midi or something), you could start the movie again after that time
Code:
length = [that long is the movie in millisecs]
start = gettickcount_()
playmovie()
Repeat
IF gettickcount_() > start + length
stopmovie()
playmovie()
Endif
until something
Try it with something like this. I haven´t tried it, but it should work.