Skip to main content
Version: 🚧 Alpha 🚧

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.

FacetTypeDescription
filenamestringAudio file (wav, mp3, ...). This path is relative to the path of the model (no facet name required)
volumefloatVolume (0-1)
repeatboolShould the sound be repeated or not? (default: false)
modeidentifierMode: overwrite or ignore (default: overwrite)

Example:

global {
start_sound "mysound.wav";
}

start_sound_music​

Plays a music file.

FacetTypeDescription
filenamestringAudio file (wav, mp3, ...) (no facet name required)
volumefloatVolume (0-1)
repeatboolShould the sound be repeated or not? (default: false)
modeidentifierMode: overwrite or ignore (default: overwrite)

Example:

global {
start_sound_music "mymusic.mp3" repeat:true;
}

stop_sound​

Stops a sound effect.

FacetTypeDescription
filenamestringName 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.

FacetTypeDescription
filenamestringName 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.

FacetTypeDescription
filenamestringName 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 {
...
}

See Also​