-
Notifications
You must be signed in to change notification settings - Fork 10
VoiceSpeech
With AGS you can link a line of dialog to a speech file, to enable "talkie"- style games. Suppose you have a dialog script with the following content:
ego: "Hi! How are you?"
michael: "I'm fine."
Normally this would display the words in the speech text above the characters heads. However, you can add the special character '&' to symbolize that a voice file should be played along with the displayed text.
The file name has the format XXXXY.EXT, where XXXX comes from the 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."
or common script using Say script function:
cEgo.Say("&10 Hi! How are you?");
cMichael.Say("&7 I'm fine.");
Both of those examples plays EGO10.WAV with the first line, and MICH7.WAV with the second. When a line of text has a voice linked to it, the text on the screen will not be removed until the voice file has finished playing. If the player interrupts it by clicking the mouse or pressing a key, the text and voice will be stopped. Voice files must be placed in the "Speech" sub-directory of the game folder.
Script functions that support playing voice clips using this style are:
- Character.Say, Character.SayAt;
- Character.Think;
-
Display and family (DisplayAt, DisplayAtY, and so forth). Display functions are using
game.narrator_speech
variable to know which character's clips to use.
NOTE: Speech file numbers are restricted to the positive range of 1 to 2147483647 (2 billion). This is a technical limitation based on how these are handled inside the engine, but we do not think that running out of numbers to use will ever become a problem to the user.
Since AGS 3.5.0 you can play voice clips directly using function Game.PlayVoiceClip.
Any sound format supported by AGS can be used for speech as well.
AGS uses separate voice packs to store the speech files. The default voice pack is compiled by placing audio files in the "Speech" sub-directory of the game folder, and is named "speech.vox".
Since version 3.6.0, AGS also supports multiple alternate voice packs. These are compiled from subdirectories nested inside the "Speech" folder, and are named "sp_DIRNAME.vox", where DIRNAME is the name of that subdirectory. The speech files in these alternate directories must have the same names as files in the "Speech" directory itself. These extra packs are used to provide voice-over for different languages.
For example, if you have this folder structure in your game project:
- Speech
-
- Francais
-
- MyLang
then the editor will create following voxes:
- speech.vox (with files only from the root "Speech" folder);
- sp_francais.vox (with files from "Speech/Francais");
- sp_mylang.vox (with files from "Speech/MyLang");
NOTE: only top-level files are included into the voice pack, any further subfolders are ignored.
Since AGS 3.6.0, the engine supports switching to a different speech vox anytime. To do so, there's a new script function Game.ChangeSpeechVox.
Note that the voice packs are considered optional, and your game will function correctly even without them, in case there is no voice pack, the game will display speech text but play no voice. This makes it possible for the game author to offer voice packs as an optional download for the players. If a particular speech file is missing from a voice pack, that will not not cause game errors and display just the text on screen.
SeeAlso: Game.ChangeSpeechVox
,
Speech.VoiceMode
Getting Started in AGS
Editor
- New Game templates
- Editor Preferences
- General Settings
- Default Setup
- Colours Editor
- Room Editor
- Character Editor
- Cursor Editor
- Dialog Editor
- Font Preview
- GUI Editor
- Inventory Items Editor
- View Editor
- Sprite Manager
- Music and sound
- Voice speech
- Script Modules
- System limits
- Log Panel
- Plugins
- Other Features
Engine
Scripting
- Scripting Tutorial
- Scripting Language
-
Scripting API
- Script API Overview
- Standard Constants
- Standard Enumerated Types
- Standard Types
- Game variables
- Global arrays
- Global event handlers
- repeatedly_execute / repeatedly_execute_always
- Custom dialog options rendering
- Global functions: general
- Global functions: message display
- Global functions: multimedia actions
- Global functions: palette operations
- Global functions: room actions
- Global functions: screen effects
- Global functions: wait
- AudioChannel functions and properties
- AudioClip functions and properties
- Camera functions and properties
- Character functions and properties
- DateTime functions and properties
- Dialog functions and properties
- DialogOptionsRenderingInfo functions and properties
- Dictionary functions and properties
- DrawingSurface functions and properties
- DynamicSprite functions and properties
- File functions and properties
- Game functions and properties
- GUI functions and properties
- GUI control functions and properties
- GUI Button functions and properties
- GUI InvWindow functions and properties
- GUI Label functions and properties
- GUI List Box functions and properties
- GUI Slider properties
- GUI Text Box functions and properties
- Hotspot functions and properties
- Inventory item functions and properties
- Maths functions and properties
- Mouse functions and properties
- Object functions and properties
- Overlay functions and properties
- Parser functions
- Region functions and properties
- Room functions and properties
- Screen functions and properties
- Set functions and properties
- Speech functions and properties
- String functions
- System functions and properties
- TextWindowGUI functions and properties
- ViewFrame functions and properties
- Viewport functions and properties
- Obsolete Script API
- Event Types
- Key code table
- Audio in script
Legal Notice
Getting in touch
Misc
Hidden