About PlaySoundEx?

Started by piraatlife4me, Fri 09/01/2004 05:49:12

Previous topic - Next topic

piraatlife4me

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

Gilbert

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.

piraatlife4me

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

evilspacefart

have you tried selecting another midi option in the setup program?

piraatlife4me

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 :)

Ben

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)..

piraatlife4me

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

SMF spam blocked by CleanTalk