wiki:sndgrp

Sound group

Sound

Sound source

Pitch

Gain

Max gain

reference distance

rolloff factor

max distance

Sound group interface (sndgrp)

The sound group interface defines the following methods and events:

type name parameters description
method load_sound filename - sound filename "ogg file"
Note: the sound sample should be mono
returns the sound ID that can be used for play in sound source
method create_source bone_id - bone ID where the sound source should be attached returns the sounds source ID
method create_source_wo_bone
method play id - source ID
sound_id - sound ID
bool looping - true if the sound should loop
bool enqueue - true if the sound should be queued after the current sounds
bool break_prev_loops - if true (default), break existing loops, else extend the loops by this one
play the sound at the source. Shortcut simplified versions below
method play_sound id - source ID
sound_id - sound ID
Play sound once, discarding older sounds
method play_loop id - source ID
sound_id - sound ID
Play a looped sound, breaking other sounds
method enqueue_sound id - source ID
sound_id - sound ID
Enqueue sound once, previous loops are finished and then discarded
method enqueue_loop id - source ID
sound_id - sound ID
bool break_prev_loops - if true (default), break existing loops, else extend the loops by this one
Enqueue looped sound. If @break_prev_loops is true, previous loops are removed after completion, and only this sound remains looped. Otherwise the new sound is added to the loop chain
method is_playing source_id returns true if the source is playing a sound
method is_looping source_id returns true if the source is playing a looping sound
method stop source_id stops the source and clean its queue
method set_pitch source_id set source pitch parameter
method set_ref_distance source_id set source reference distance
method set_gain source_id set source gain

See aircraft, vehicle

Last modified 5 years ago Last modified on Jun 13, 2013, 7:17:41 PM