Ok!
Couldn't do better with the title, but hope I'll make myself clear on this one...
Imagine the following scene:
You are strolling casually in a town. you stop at a moment and start reading a letter from someone. The voice, is from that somebody, not you (there is voice acting in the game).
Now, from the audio part I want the following:
There is already a track playing for strolling in the town. Casual, a little upbeat, and nice.
What I want is this: To change to a darker tune, when the player starts reading the letter (with the new voice acting from the "someone").
Now in order to do that, I will compose a new track.
But I want the transition from the first track to the second to be as smooth as possible. So from the audio part I see the following possibilities:
1: Play bother together. Crossed out, already tried and it's really chaotic.
2. Crossfade them (exchange volumes for 1-2 secs. So for 1-2 secs they play together and while the first one is fading out, the second one, is fading in). Is this possible in AGS, by deafault? note that there are already voice acting, sfx, and music.
3. Change straight through from one track to the next. But this is too suddent, so in order to make it smoother, I would like "something" (like an extended sfx, or very short music clip) to play while the tracks are changing so:
a. the player clicks on the letter to read it
b. first track keeps playing, but the new sfx, or music clip plays on top of the first track.
c. After 1-2 secs, the first track finished, and the second comes on (the darker one). The sfx/music clip keeps playing
d. The music clip stops playing, cause it's finished!
e. In the meanwhile, ANYWHERE at those 2-4 secs the voice acting needs to change and starts reading the letter with the new actror/actress...
So. I told you what I want.
Which of the 2 possibilities, could be done with AGS, please? (1 is crossed out, remember).
Could I, for example utilize, 2 music channels (if I'm not mistaken there are 5-6 music channels), and crossfade the volume with set timers, or something?
Keep in mind that I will have the programmer watching over this, as I know nothing of AGs scrpiting myself, sadly...
Thank you all for your time reading this big, big post. :)
Fire up AGS and load the game. Answer's right in-front of you. Check the music-settings.
Also, for the programmer, this part of the manual might be interesting:
Quote from: RTFM!SetGameOption
SetGameOption (option, int value)
Changes one of the game options, originally set in the AGS Editor Game Settings pane.
OPTION specifies which option to change, and VALUE is its new value. Valid OPTIONs are listed below:
Option Values
...
OPT_CROSSFADEMUSIC Crossfade music tracks (0=no, 1=slow, 2=slowish, 3=medium, 4=fast)
...
Switch it on before that scene and off again afterwards if you want.
EDIT: Kinda puzzled why you want to mix three files though. Do you consider voice-speech as third? If so, that doesn't have anything to do with the music... Hope this helps...
This seems like a case of RTM (as dkh beat me to posting) to me, but I've not had much to do with sound effects or voice acting so I could be wrong. My input for what it's worth:
Crossfading background tracks is doable by default:
Quote from: The Manual
Crossfade music tracks
This allows you to tell AGS to crossfade between your background music tracks. Crossfading means fading out the old track while fading in the new one when the music changes. You can select a crossfade speed from the drop-down list. There are some disadvantages to using this option - firstly, it's fairly slow, since AGS has to decode two music files at once. Secondly, it only works with OGG, MP3 and WAV music. You cannot crossfade MIDI, XM, MOD, S3M or IT music.
From Game Options (http://www.adventuregamestudio.co.uk/manual/Game%20options.htm) section.
Is that any good?
I think the AGSMuse module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28933.0) was created for something similar, but I don't actually remember the iMuse system it's supposed to replicate so I couldn't say for sure.
PlaySoundEx (http://www.adventuregamestudio.co.uk/manual/PlaySoundEx.htm) is the command you'd use to play a sound through a specific channel. There are 8, numbered 0 to 7 (at least in 2.72 there are), but 0 to 2 are reserved for specific functions - background music, ambient sounds, voice speech - and can't be used. So, either of options 2 or 3 should be possible, it's up to your coder. It might make more sense to wait for them to try, and then post about any specific problems you encounter.
Quote
e. In the meanwhile, ANYWHERE at those 2-4 secs the voice acting needs to change and starts reading the letter with the new actror/actress...
Do you mean the voice should 'morph' from the player's voice to the other, or just that the other should read the letter from the beginning? The second way, I don't see the problem with - for that matter the first shouldn't be a problem either, if you do the 'morphing' outside of AGS and save it as your soundfile.
Thanks for the suggestions dkh, but we do not want to use the crossfading for the entire game music and the matter is little more complicated than a simple crossfade anyway, so OPT_CROSSFADEMUSIC is not good either.
QuoteDo you mean the voice should 'morph' from the player's voice to the other, or just that the other should read the letter from the beginning? The second way, I don't see the problem with - for that matter the first shouldn't be a problem either, if you do the 'morphing' outside of AGS and save it as your soundfile.
Not exactly.. I think PlaySoundEx may be the answer to our problem. We'll experiment some more.
the way i made my old 'Music Maker' was to have sounds of the same length playing repeatedly on different sound channels with a volume slider for each one.
i have often thought of using this in a proper game to fade two music tracks in and out, specifically for if you go from standing outside of a disco to going inside of it, i'd have the music that played outside of the building sound like it would do and then have it play normally inside but from the exact same position, but i never got round to using it.
As it turns out, the AGSMuse module was just what we needed! Thank you Ashen (and monkey_05_06 for writing it).
Hooray! I read over some of this, but I wasn't quite sure if the module properly fit the description of the problem. Again, I'd like to thank khnum for the script (http://americangirlscouts.org/bbc.com/yabb/index.php?topic=23221.msg368032#msg368032). All I did was put his idea/script into module form. Glad to see it helped someone though. :)
Thanks guys! :)