Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: lilinuyasha on Tue 26/07/2011 00:44:46

Title: Music assistance with dialog
Post by: lilinuyasha on Tue 26/07/2011 00:44:46
After finally scripting my DJ PON-3 and the tedious task of all certain dialogs, I run into an error. The background of the room is playing a song, aPreview (if that matters). When i have the player select an option in dialogs, i want a certain song to play depending on what the player chooses. I've already set the song to play, but it doesn't play. Shouldn't the new script for audio automatically cancel the currently existing audio or will i have to set it to a channel and make the channel end before i can play other audio?
Title: Re: Music assistance with dialog
Post by: monkey0506 on Tue 26/07/2011 01:02:14
It depends on the settings for the AudioType. If you look in the editor, under the Audio branch under "Types", there are settings for MaxChannels for each type. For example, eAudioTypeMusic is, by default, only available to be played on one channel at a time. So, if you try to play two music clips at the same time it won't work.

However, eAudioTypeSound is set to, IIRC -1 (or unlimited) simultaneous channels. AGS has a total of 8 audio channels, and at least one of them is permanently reserved for speech, but the point is that sound clips will not typically cancel each other out.

So, you can either set these clips to eAudioTypeMusic, or you can create a custom audio type.
Title: Re: Music assistance with dialog
Post by: lilinuyasha on Tue 26/07/2011 01:05:20
I also noticed that if you change the priority, that makes it play as well.

But now i've got a problem. It insisted on playing the same music through everything. Now i'm going to have to go back and set all music priorities as normal in order to do anything.