Can't get .mid files to pley using PlayMusic
BlitzPlus Forums/BlitzPlus Programming/Can't get .mid files to pley using PlayMusic
| ||
Can anyone else get this code snippet to work? of course, you will have to substitute your own .mid file.chnTitle=PlayMusic("Title.mid") If chnTitle = 0 Then RuntimeError("file not loaded") WaitKey() EndI can't get it to work and keep getting "file not loaded" errors. The .mid file is in the same directory as the executable. I can play the .mid files fine from within Windows MediaPlayer and Magix Midi Studio. I can't play them from Blitz3D (I have Blitz3D version IDE 1.85, Linker 1.64, Runtime 1.85) nor from BlitzPlus (ver IDE 1.35, Linker 1.10, Runtime 1.37) either as executables or from within Blitz. This all happens regardless of the .mid file I substitute. The strange thing is that it used to work fine a while back. I don't remember when exactly it stopped working. |
| ||
what happens when u put a ; in front of If chnTitle = 0 Then RuntimeError("file not loaded") comment it out.like this ;If chnTitle = 0 Then RuntimeError("file not loaded") |
| ||
If I comment out that line, absolutely nothing happens (no music plays, no windows pop up). Also, I tried this: chnCool=PlayMusic("cool.wav") If chnCool = 0 Then RuntimeError("wav file not loaded") chnTitle=PlayMusic("Title.mid") If chnTitle = 0 Then RuntimeError("mid file not loaded") WaitKey() EndAnd the wav file plays but the mid file doesn't (and I get the 'mid file not loaded' message). Both files are in the same directory as the exe. It's not making sense. |
| ||
I noticed Midi stopped functioning after doing the updates for Blitz Plus also. Suggestions : Render the midi into another format. wma is free (no license) asf is free (no license) And what happens if you load the midi then play it from memory? |
| ||
If you meant to try this:chnTitle=LoadSound("Title.mid") PlaySound(chnTitle) If chnTitle = 0 Then RuntimeError("mid file not loaded") WaitKey() Endthen that doesn't work either. (However, I don't think .mid files can be loaded with LoadSound) Should this be posted in the Bugs forum? |
| ||
We're onto it, seems to be happening with some midi files and not others, will hopefully be fixed in next update. |
| ||
@Skidracer When *is* the next BlitzPlus update? any estimate? |