HGE::Effect_PlayEx

Starts playing a sound effect with additional parameters.

HCHANNEL Effect_PlayEx(
  HEFFECT effect,
  int volume = 100,
  int pan = 0,
  float pitch = 1.0,
  bool loop = false
);

Parameters

effect
Handle of a sound effect to be played.
volume
Optional effect volume from 0 to 100. Default is 100, meaning maximum volume.
pan
Optional effect panning from -100 to 100. Default is 0, meaning center panning.
pitch
Optional effect pitch multiplier. Default is 1.0, meaning default pitch.
loop
Optional parameter. If true, the effect is looped until the audio channel is stopped manually. Default is false.

Return value

Returns the audio channel handle through which the effect is playing. Use this handle with audio channel control functions.

Remarks

Maximum four instances of a particular sample can be played at the same time. If all four instances are already playing during a call to Effect_PlayEx, the instance with the lowest volume is restarted with new parameters.

Requirements

Header: hge.h
Import library: hge.lib

See also

Effect_Load, Effect_Free, Effect_Play