Skip to content

class_sampleplayer2d

reduz edited this page Feb 23, 2014 · 10 revisions

SamplePlayer2D

####Inherits: SoundPlayer2D ####Category: Core

Brief Description

Sample player for Positional 2D Sound.

Member Functions

Numeric Constants

  • INVALID_VOICE = -1 - If the voice is invalid, this is returned.
  • NEXT_VOICE = -2

Description

Sample player for Positional 2D Sound. Plays sound samples positionally, left and right depending on the distance/place on the screen.

Member Function Description

Set the sample library for the player.

Return the sample library used for the player.

  • void set&#95polyphony ( int voices )

Set the polyphony of the player (maximum amount of simultaneous voices).

  • int get&#95polyphony ( ) const

Return the polyphony of the player (maximum amount of simultaneous voices).

Play a sample, an internal polyphony id can be passed, or else it's assigned automatically. Returns a voice id which can be used to modify the voice parameters.

  • void voice&#95set&#95pitch&#95scale ( int voice, real ratio )

Change the pitch scale of a currently playing voice.

  • void voice&#95set&#95volume&#95scale&#95db ( int voice, real db )

Change the volume scale of a currently playing voice (using dB).

  • bool is&#95voice&#95active ( int voice ) const

Return true if a voice is still active (false if it stopped playing).

  • void stop&#95voice ( int voice )

Stop a given voice.

  • void stop&#95all ( )

Stop all playing voices.

Clone this wiki locally