Sound Extension
Extension: gama.extension.sound
The Sound extension provides a collection of statements that are associated with sound effects.
Statements​
start_sound​
Starts a sound effect.
| Facet | Type | Description |
|---|---|---|
filename | string | Audio file (wav, mp3, ...). This path is relative to the path of the model (no facet name required) |
volume | float | Volume (0-1) |
repeat | bool | Should the sound be repeated or not? (default: false) |
mode | identifier | Mode: overwrite or ignore (default: overwrite) |
Example:
global {
start_sound "mysound.wav";
}
start_sound_music​
Plays a music file.
| Facet | Type | Description |
|---|---|---|
filename | string | Audio file (wav, mp3, ...) (no facet name required) |
volume | float | Volume (0-1) |
repeat | bool | Should the sound be repeated or not? (default: false) |
mode | identifier | Mode: overwrite or ignore (default: overwrite) |
Example:
global {
start_sound_music "mymusic.mp3" repeat:true;
}
stop_sound​
Stops a sound effect.
| Facet | Type | Description |
|---|---|---|
filename | string | Name of the sound file to be stopped (no facet name required) |
stop_sound_music​
Stops a music file.
No facets required.
pause_sound​
Pauses a sound effect.
| Facet | Type | Description |
|---|---|---|
filename | string | Name of the sound file to be paused (no facet name required) |
pause_sound_music​
Pauses a music file.
No facets required.
resume_sound​
Resumes a paused sound effect.
| Facet | Type | Description |
|---|---|---|
filename | string | Name of the sound file to be resumed (no facet name required) |
resume_sound_music​
Resumes a paused music file.
No facets required.
Species​
SoundEffect Species / SoundPlayer Species​
The extension provides a species that agents can be defined as if agents need to play sound effects.
Example:
species SoundEffect type: sound_player skills: [fipa] {
...
}
SoundMusic / MusicPlayer Species​
The extension provides a species that agents can be defined as if agents need to play musics.
Example:
species SoundMusic type: music_player {
...
}