PlayMusic doesn't seem to work without a little help from WMP

Started by aweeks007, Tue 06/10/2009 03:52:11

Previous topic - Next topic

aweeks007

This is my first attempt at developing within AGS, and I'm trying to touch on a little of everything before I dive in.

I'm running into a problem where my background midi doesn't play, unless windows media player happens to be open.

I have a file called music1.mid in my Music subfolder in my game's project folder.  I have a PlayMusic(1) in a function tied to after fade-in for my room.  I also have a Display() in the same function, so I have verified the function is being called.  When I run the game, either with or without the debugger or compiled, music does not play (or so it seems).  I noted that the Demo 3 game also has midi and playmidi references, so I figured that should work "out of the box" but it seems I get the same behavior.  At some point, I opened windows media player in frustration, figuring I would humor myself and play a midi manually, but when i opened it, the midi was playing, at approximately the right beat location as it would have been at had the midi started when the room had loaded.

I have now confirmed that having media player open will allow the music to play, closing the media player while the game and music are running will cause the music to stop - the game continues on and does not crash.  Midi seems to work fine elsewhere in other programs on my computer.  I have also downloaded one other AGS game (compiled) and verified that the midi in that works.  So it seems to be some environmental screw up on my part related to compiling or running from within AGS.

I'm hoping it is something simple.  Any ideas of what I am missing?

Ethan D

I remember having problems with getting midi files to play.  For me I just had to open the sound mixer and there was one section that was set to zero.   Hope that helps.

SMF spam blocked by CleanTalk