Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: piraatlife4me on Fri 09/01/2004 05:49:12

Title: About PlaySoundEx?
Post by: piraatlife4me on Fri 09/01/2004 05:49:12
Hey Ags forums, Ok! This is going to sound like a really stupid question but here it goes!  And it has probably been answered about a thousand times by now but for some reason my midi music files will not play in my game.  And for some reason it is just on my computer?  I tried to run it on another computer and the midis played fine.  Is there some kinda of setting in AGS I need to change?  Anyone know of any troubleshooting tips for this one? And by the way Does anyone know in AGS how can you loop a PlaySoundEx function? I have soundfx that I want to be run continously in the background over the background (midi) music.
Thanks
Daniel
Winebarger
Title: Re:About PlaySoundEx?
Post by: Gilbert on Fri 09/01/2004 05:57:04
MIDI: if the midis don't play just on your own computer, check the settings of your sound card driver (did they play using media player, etc. ? Though I expect the answer was YES...) , and try messing with the setup of the game, you may also try turning the midi volume of your windows mixer all the way to the top before testing a game, in case it's one of those strange AGS behaviour that have the midi volume too low in some computers.

For the looping sound, here is a example:

Suppose you want sound #7 to be played continuously in a room, and say, play it in channel #5, just add to that room's repeatedly execute script:

if  (IsChannelPlaying(5)==0)  PlaySoundEx(7, 5);



...oops it's exactly like the example in the IsChannelPlaying() entry in the manual.
Title: Re:About PlaySoundEx?
Post by: piraatlife4me on Fri 09/01/2004 07:29:42
Hey Gilbot!
Thanks for helping me! I think I figured out what's going on here.  I noticed that when I run my game in a window instead of full screen and minimize it,  the sound somehow plays.  But when I open the game back up it stops.  I can't seem to figure out why it keeps doing that. Any ideas on that? Because the midis are playing just not while AGS is running.  Thanks again for the support.
Daniel
Winebarger
Title: Re:About PlaySoundEx?
Post by: evilspacefart on Fri 09/01/2004 07:33:35
have you tried selecting another midi option in the setup program?
Title: Re:About PlaySoundEx?
Post by: piraatlife4me on Fri 09/01/2004 08:10:37
A Ha! That was it! You were right it was set under the wrong driver in the game set up configuration.  I should have known an easy thing to overlook.  But now it works so thanks guys for the help, my problem is solved :)
Title: Re:About PlaySoundEx?
Post by: Ben on Fri 09/01/2004 20:15:00
Do you need to play the sound in a specific channel? Because if not, it would be better to use PlayAmbientSound instead of the loop Gilbert game you. That way it won't stop suddenly if the repeatedly_execute script is paused (for example, if there's speech on the screen)..
Title: Re:About PlaySoundEx?
Post by: piraatlife4me on Fri 09/01/2004 21:04:31
Hey Ben!
It's Dan here!  Yeah you're right I forgot to take that into consideration.  So for those types of situations I guess I will have to go with PlayAmbientSound.  Thanks for looking out!
Daniel
Winebarger