Category: Effects
Since engine version: 4.0 OC
SoundAt
Description
Plays a sound at the specified position. The specified sound file has to be available in the group Sound.ocg, in the active scenario file, or in any loaded object definition.
Syntax
bool SoundAt(string name, int x, int y, int volume, int player, int custom_falloff_distance, int pitch, proplist modifier);
Parameters
- name:
- Name of the sound effect (without .wav/.ogg extension). Wildcards as used by WildcardMatch are used.
- x:
- X-Position of the sound effect. An offset if called from object-context.
- y:
- Y-Position of the sound effect. An offset if called from object-context.
- volume:
- [opt] 0-100: volume for playback of the sound. A volume value of
nil
means playback at 100. - player:
- [opt] Player number of the player for which the sound is to be played. In network games, the sound will thus not be audible for the other players. If
nil
(or not specified), the sound will be played for all players. - custom_falloff_distance:
- [opt] The further away the sound effect from the player, the more quiet it is played. By default, the sound will not be hearable anymore in a distance of 700 pixels. A custom distance can be specified here.
- pitch:
- [opt] Pitch modification between -90 and 1000. Values larger than zero let the sound play the faster and at a higher pitch. The resulting speed multiplication factor is (pitch + 100) / 100.
- modifier:
- [opt] Sound modifier for special effects such as reverb or echo. See Sound modifiers.
See also: Sound
See also: Music
See also: Sound modifiers