Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Vverano7 on Sun 12/08/2018 02:58:33

Title: Playing Audio in Dialogue Scripts
Post by: Vverano7 on Sun 12/08/2018 02:58:33
Hi,
How can I play audio via the Dialog functions in AGS? I know that when you can use &1 &etc... when you have a character.Say, but how can I do the equivalent in the dialog? The dialog uses a strange syntax of its own and doesn't respond to any such &1 command.

Thank you.


The manual addresses it here. http://www.adventuregamestudio.co.uk/manual/ags13.htm#MusAndSound

However, I believe I have a problem with how I name the files.

"The file name has format XXXXY.EXT, where XXXX is made of up to first four letters of the character's script name (except the leading 'c'), the Y is the speech file number (with no leading or trailing zeroes or padding of any kind), and EXT is the file extension.

For example, if you have dialog script:

ego: &10 "Hi! How are you?"
michael: &7 "I'm fine." "

My script name is just aFox01, and I use &01, and the audio still won't play???
Title: Re: Playing Audio in Dialogue Scripts
Post by: Slasher on Sun 12/08/2018 04:50:05
Code (ags) Select

//Example and make sure the speech audio goes into the Speech Folder.
cBert.Say("&1 I need to see someone in the TV Centre.");
Title: Re: Playing Audio in Dialogue Scripts
Post by: Cassiebsg on Sun 12/08/2018 06:34:25
For dialogues, your files can't be named like that and they don't need to be imported into AGS.

What you need to do:

ego: &10 "Hi! How are you?"
michael: &7 "I'm fine." "

cEGO's speech file would be named EGO10.ogg (or .mp3 or .wav depending on which sound format you are using).

cMichael's speech would be named MICH7.ogg

Then all speech files you just place them on the speech folder of the game.

Note: Remember that you can not use leading zeros in the file names... MICH7.ogg if not the same as MICH0007.ogg...
Title: Re: Playing Audio in Dialogue Scripts [SOLVED]
Post by: Vverano7 on Sun 12/08/2018 18:27:45
Thanks, I changed the script names of my wav files. Could it also be something to do with VOX?

"Try clicking Game â€"> Rebuild VOX files. This will re-build all the files that AGS uses to store the music/sound. If you added new files, you must do this every time."

I can't seem to find the Game = Rebuild VOX file function, where can I find it in AGS?
Additionally, my wav files are in the Sound folder in the Speech directory, is there anything wrong with the folder I've chosen?


Thanks

I see what you mean in regard to importing audio. I placed them in the speech folder of the game just like you said, and now the audio works! Thank you.