Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Darkmaster400 on Fri 23/06/2006 10:56:44

Title: Music Problem.
Post by: Darkmaster400 on Fri 23/06/2006 10:56:44
Hello mates,

I have a problem playing music..
Well, I added the file onto the Music folder in the game folder.
Now I try the code:

PlayMusic(1)

It is in .mid format (in other words a midi file).

Now when I start up the game, I dont hear any music.
Well, I really doubt that I have the right interaction.

What is the right interaction to play a musicfile on Room Load??

Regards,

---
Title: Re: Music Problem.
Post by: GarageGothic on Fri 23/06/2006 11:02:24
If you're using the interaction editor:
Player Enters Screen (before fadein) -> Game - Play Music -> Change music number to 1

Also make sure that the midi file is named music1.mid
Title: Re: Music Problem.
Post by: DoorKnobHandle on Fri 23/06/2006 11:03:21
"PlayMusic(1);" should work (with a comma at the end of the line), make sure that your file is called "MUSIC1.MID" in this case.

Which AGS version do you use? Make sure that your music file is in the correct location (in the game folder and not in the compiled-subfolder, as you said or, when you use a newer version >2.7, then in the special "Music" subfolder).

Edit: GG beat me.
Title: Re: Music Problem.
Post by: Darkmaster400 on Fri 23/06/2006 11:42:55
Quote from: GarageGothic on Fri 23/06/2006 11:02:24
If you're using the interaction editor:
Player Enters Screen (before fadein) -> Game - Play Music -> Change music number to 1

Also make sure that the midi file is named music1.mid

Hmm I cant find the "Player Enters Screen" Interaction :/
Title: Re: Music Problem.
Post by: GarageGothic on Fri 23/06/2006 11:45:00
Sorry, it's Player Enters Room
Title: Re: Music Problem.
Post by: Darkmaster400 on Fri 23/06/2006 12:12:45
Hmm, it still doesnt seem to play..Ã,  :-\

EDIT: Does it support the .mid format, or shall I convert it to .ogg format?
Title: Re: Music Problem.
Post by: Gilbert on Fri 23/06/2006 12:25:48
Please check your window explorer's setting, would it be possible that the "hiding known extensions" option was checked (which is, by default) ?

In that case, you might have named the file music1.mid.mid instead of music1.mid .
Title: Re: Music Problem.
Post by: Darkmaster400 on Fri 23/06/2006 12:34:13
Quote from: Gilbot V7000a on Fri 23/06/2006 12:25:48
Please check your window explorer's setting, would it be possible that the "hiding known extensions" option was checked (which is, by default) ?

In that case, you might have named the file music1.mid.mid instead of music1.mid .

Yes, I checked it already.. Hmm, the filename is now "music1.mid" <--- is it correct?
Title: Re: Music Problem.
Post by: Gilbert on Fri 23/06/2006 12:39:56
try setting up the game to use another device to play midi files, maybe it's a driver problem.
Title: Re: Music Problem.
Post by: Darkmaster400 on Fri 23/06/2006 12:57:30
Quote from: Gilbot V7000a on Fri 23/06/2006 12:39:56
try setting up the game to use another device to play midi files, maybe it's a driver problem.

Oh no, it wont solve it .. Hmm, I can listen to the midi file seperately in Windows Media Player.
Shall I try another version of AGS ? Maybe that will solve it  ::).
Title: Re: Music Problem.
Post by: SSH on Fri 23/06/2006 13:12:58
Wheteher it plays in Windows Media is immaterial:

Use the game setup for the AGS game and you'll see an ioption to change the way AGS plays MIDIs: try chnaging it.
Title: Re: Music Problem.
Post by: Darkmaster400 on Fri 23/06/2006 13:17:39
Oh, it cant be true.. still no sucess.. :-/
Title: Re: Music Problem.
Post by: SSH on Fri 23/06/2006 13:25:31
Try: playign an OGG, playign a different MIDI, playing a sound-effect to see if you can eliminate the problem. Also, which version of AGS are you using?
Title: Re: Music Problem.
Post by: Darkmaster400 on Fri 23/06/2006 13:35:04
Quote from: SSH on Fri 23/06/2006 13:25:31
Try: playign an OGG, playign a different MIDI, playing a sound-effect to see if you can eliminate the problem. Also, which version of AGS are you using?

Arrgh.. still no success.
Oh and I think I am using the newest AGS version, version 2.71

EDIT: I think I am using a BETA. I read the FAQ and it said that the BETA releases arent as
stable as the official, where the BETA may have bugs.. Can there be bugs in the BETA version
which makes AGS not playing the music files correct?
Title: Re: Music Problem.
Post by: SSH on Fri 23/06/2006 13:48:19
Yes, and a quite recent beta DID have such problems. Try downloading  the most recent beta, and try again. Also, you can find the version under the Help_>About menu
Title: Re: Music Problem.
Post by: GarageGothic on Fri 23/06/2006 13:54:18
Yes, I commented on this in Darkmaster400's first thread in the Tech forum (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=27076.0) but I wonder if he noticed.
Title: Re: Music Problem.
Post by: Darkmaster400 on Fri 23/06/2006 14:04:51
To be secure of bugs, isnt it best to use the official versions?  :)
Title: Re: Music Problem.
Post by: GarageGothic on Fri 23/06/2006 14:10:29
Unless you need special functions added after the last stable version (2.71) it's best to stick with that, yes. However, if you created the game with a later 2.72 beta version of the editor, you can't revert to a previous version. Then your only solution is to get the latest beta (RC2a) where CJ fixed the audio bugs introduced in RC2.
Title: Re: Music Problem.
Post by: Darkmaster400 on Fri 23/06/2006 14:29:04
Arrgh... Now I got AGS 2.72RCa, but I can still not play music..  >:(
Title: Re: Music Problem.
Post by: monkey0506 on Fri 23/06/2006 14:44:10
Hey Lars, if you still need help with this I'm getting on MSN now...we've discussed this same problem before.  Come on Lars, it's not that hard... :P
Title: Re: Music Problem.
Post by: Darkmaster400 on Fri 23/06/2006 15:11:39
Oh no?? well, then fix U itÃ,  ;D

EDIT: I found the problem, my mate ran it and then it worked..
I think its my computer... Darnage!111!!!111 8)
Title: Re: Music Problem.
Post by: monkey0506 on Fri 23/06/2006 15:21:19
Okay...Lars shared with me his game folder...and...the music works fine for me.

I had him try both the Default MCI Music Device and the Win32 Music Mapper, made sure that the volume was turned up (both on his computer and in AGS), made sure the MIDI was named correctly, made sure he had run the interaction correctly...nothing worked for him.

Lars Darkmaster400 has actually done his job correctly here, there just appears to be some sort of problems with the hardware playing back the music on his computer.

If anyone has any suggestions, please feel free to offer them because poor guy ( :=) has done everything in his power to make this work...

And, yes Lars..."Darnage!!111two" indeed.  Darnage indeed.
Title: Re: Music Problem.
Post by: Darkmaster400 on Fri 23/06/2006 20:07:29
Hey, no worries now!!  :D
I got it working !! FINALLY  ;D ;D

Thx for support  8)
Title: Re: Music Problem.
Post by: Ashen on Fri 23/06/2006 20:21:34
Was it a hardware problem, then?
Also, could you post what you did, for anyone else with the same problem.
Title: Re: Music Problem.
Post by: Darkmaster400 on Sat 24/06/2006 00:28:48
Quote from: Ashen on Fri 23/06/2006 20:21:34
Was it a hardware problem, then?
Also, could you post what you did, for anyone else with the same problem.

Yes, but what I did didnt quite fix the problem..
I simply reinstalled the soundcard drivers, and then it was working fine 1st time..
Then the second time I tried it was no music..
The music in other AGS games, which you can download will sucessfully work, but not the
ones I make.

I can also play the music file in a seperat media player, such as Windows Media Player.