PlaySoundEx: Difference between revisions
From Eternity Wiki
Jump to navigationJump to search
Esselfortium (talk | contribs) No edit summary |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
'''PlaySoundEx''' ( | {{codepointer|description= | ||
Plays a sound, allowing various customization settings. | |||
|usage= | |||
'''PlaySoundEx'''(''soundname'', ''channel'' [, ''loop'' [, ''attenuation'' [, ''volume'']]]) | |||
|parameters= | |||
*soundname: The "nice name" of the sound to play. See the [[Sound]] EDF block documentation for how to define this. | |||
*soundname: The "nice name" of the sound to play. See [[ | |||
*channel: The channel to play the sound on. Sound played on separate channels will not interfere with each other. Valid values are: | *channel: The channel to play the sound on. Sound played on separate channels will not interfere with each other. Valid values are: | ||
**chan_auto, 0 | **chan_auto, 0 | ||
Line 19: | Line 16: | ||
*loop: If true, the sound will play in a continuous loop. | *loop: If true, the sound will play in a continuous loop. | ||
*attenuation: Controls how the sound falls off with distance. Legal values are: | *attenuation: Controls how the sound falls off with distance. Legal values are: | ||
**attn_normal: Use the close_dist and clipping_dist fields defined in the sound definition. | **attn_normal: Use the close_dist and clipping_dist fields defined in the [[sound]] definition. | ||
**attn_idle: Use DOOM's normal default sound attenuation behavior. | **attn_idle: Use DOOM's normal default sound attenuation behavior. | ||
**attn_static: Fades quickly (inaudible from 512 units). | **attn_static: Fades quickly (inaudible from 512 units). | ||
**attn_none: Plays at this ambience definition's volume level regardless of distance. | **attn_none: Plays at this ambience definition's volume level regardless of distance. | ||
*volume: The volume to play the sound at, this can be a value from 0-127. 0, being the default, is equivalent to 127. | *volume: The volume to play the sound at, this can be a value from 0-127. 0, being the default, is equivalent to 127. | ||
|examples= | |||
Frame definition: | |||
frame DEMOFRAME <nowiki>{ cmp = "TROO | A | * | -1 | PlaySoundEx(Cow_Moo, chan_body, 0, attn_idle) | @next" }</nowiki> | |||
frame DEMOFRAME { cmp = "TROO | A | * | -1 | PlaySoundEx(Cow_Moo, chan_body, 0, attn_idle) | @next" } | |notes=Each actor has its own set of channels to play sounds on, so sounds played by different actors will not affect each other. This function allows sounds to be played on a specific channel, which can allow for multiple sounds generated from one actor simultaneously that would normally cut each other off, or other special effects. | ||
|seealso= | |||
*[[PlaySound]] | |||
}} |
Latest revision as of 02:48, 19 April 2020
Description
Plays a sound, allowing various customization settings.
Usage
PlaySoundEx(soundname, channel [, loop [, attenuation [, volume]]])
Parameters
- soundname: The "nice name" of the sound to play. See the Sound EDF block documentation for how to define this.
- channel: The channel to play the sound on. Sound played on separate channels will not interfere with each other. Valid values are:
- chan_auto, 0
- chan_weapon, 1
- chan_voice, 2
- chan_item, 3
- chan_body, 4
- 5
- 6
- 7
- loop: If true, the sound will play in a continuous loop.
- attenuation: Controls how the sound falls off with distance. Legal values are:
- attn_normal: Use the close_dist and clipping_dist fields defined in the sound definition.
- attn_idle: Use DOOM's normal default sound attenuation behavior.
- attn_static: Fades quickly (inaudible from 512 units).
- attn_none: Plays at this ambience definition's volume level regardless of distance.
- volume: The volume to play the sound at, this can be a value from 0-127. 0, being the default, is equivalent to 127.
Examples
Frame definition:
frame DEMOFRAME { cmp = "TROO | A | * | -1 | PlaySoundEx(Cow_Moo, chan_body, 0, attn_idle) | @next" }
Notes
Each actor has its own set of channels to play sounds on, so sounds played by different actors will not affect each other. This function allows sounds to be played on a specific channel, which can allow for multiple sounds generated from one actor simultaneously that would normally cut each other off, or other special effects.