PlaySoundEx: Difference between revisions

From Eternity Wiki
Jump to navigationJump to search
(Initial submit. Based on the equivalent article on the ZDoom wiki, with modifications where needed.)
 
No edit summary
Line 1: Line 1:
'''PlaySoundEx''' (string ''soundname'', string ''channel'' [, bool ''loop'' [, int ''attenuation'']])<br>
'''PlaySoundEx''' (string ''soundname'', string ''channel'' [, bool ''loop'' [, int ''attenuation'' [, int ''volume'']]])<br>


==Usage==
==Usage==
Line 23: Line 23:
**static: Fades quickly (inaudible from 512 units).
**static: Fades quickly (inaudible from 512 units).
**none: Plays at this ambience definition's volume level regardless of distance.
**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==
==Examples==


  frame DEMOFRAME  { cmp = "TROO | A | * | -1 | PlaySoundEx(Cow/Moo, chan_body, 0, idle) | @next" }
  frame DEMOFRAME  { cmp = "TROO | A | * | -1 | PlaySoundEx(Cow/Moo, chan_body, 0, idle) | @next" }

Revision as of 03:17, 21 April 2009

PlaySoundEx (string soundname, string channel [, bool loop [, int attenuation [, int volume]]])

Usage

Plays the a sound on the specified channel. 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.

Parameters

  • soundname: The "nice name" of the sound to play. See ESOUNDS 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:
    • normal: Use the close_dist and clipping_dist fields defined in the sound definition.
    • idle: Use DOOM's normal default sound attenuation behavior.
    • static: Fades quickly (inaudible from 512 units).
    • 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 DEMOFRAME   { cmp = "TROO | A | * | -1 | PlaySoundEx(Cow/Moo, chan_body, 0, idle) | @next" }