.mid woes... again..
Blitz3D Forums/Blitz3D Beginners Area/.mid woes... again..
| ||
music=PlayMusic("test.mid") Print "Playing.." While Not KeyHit(1) If Not ChannelPlaying(music) Then music=PlayMusic("test.mid"):Print "Looping.." Wend End That should play the song and "loop" it, right? Well, it doesn't. I don't hear any sound at all. I can hear .mids fine through Windows Media Player, so it must be a blitz thing. Does anyone else have this problem? |
| ||
Does Blitz support .mid? |
| ||
Yup, but only when using PlayMusic(), so you can't use LoopSound. |
| ||
Haven't checked your code, but every version of Blitz has had issues with mids because it uses fmod for sound. Somewhere in the code archives should be some userlibs for using winmm to play sounds. You can play MID & WAV through that and it should work fine on most PCs. |
| ||
The latest versions of Blitz play .mid files OK. |
| ||
The latest versions of Blitz play .mid files OK. I don't think so. You used to be able to go... soundtrack=PlayMusic ("whatever.mid") Repeat Until ChannelPlaying(soundtrack)=True While ChannelPlaying(soundtrack)=True ;CODESTUFF Wend ...but that's been effectively broken for ages (and I mean YEARS ages), slowing down program execution to a crawl. If anyone finds otherwise I'd appreciate you posting to correct me. |
| ||
Well, if I can't play mids in blitz, can someone point me to a .mid to mp3, wav or some other blitz campatable format(preferably free)? I have tried Audacity, but it can't convert properly, and Goldwave doesn't either. There is also .mid Converter, but that costs money... |
| ||
You can still play them... the code I posted polls the playback routine as a condition to stay in a loop (typical use: a demo that ends when the music finishes). If you don't need to test whether the midi is playing in this fashion then you won't suffer the slowdown. However I would still avoid midi simply due to you having no clue how the music will sound on any one machine. Most sound cards come with some sort of .WAV recorder. You can usually set these to record midi output, so getting a .WAV of your midi files should be easy enough (just hit record then start playing the midi file). After that you can use DBPowerAmp (a free utility) to convert the .WAV to .OGG (a free lossy compressed format supported by Blitz). |
| ||
How would you access the WAV recorder of your sound card? |
| ||
That's what I'd like to know.... |
| ||
If your card didn't come with a sound recorder just Google for a freeware one... http://www.google.co.uk/search?q=freeware+sound+recorder |
| ||
Use TiMidity++. It can export MIDIs as WAV, MP3 or OGG and also substantially improves the quality! |