SoundPlayer

sound SoundPlayer

SoundPlayer is an interface for the sound players, who are responsible for actually playing the sounds, i.e. the tracks or the tones.

Extends

  • PsychObject

Methods

(abstract) getDuration()

Source:

Get the duration of the sound, in seconds.

(abstract) play(loopsopt)

Source:

Start playing the sound.

Parameters:
Name Type Attributes Description
loops number <optional>

how many times to repeat the sound after it has played once. If loops == -1, the sound will repeat indefinitely until stopped.

(abstract) setDuration()

Source:

Set the duration of the sound, in seconds.

(abstract) setLoops(loops)

Source:

Set the number of loops.

Parameters:
Name Type Description
loops number

how many times to repeat the sound after it has played once. If loops == -1, the sound will repeat indefinitely until stopped.

(abstract) setVolume(volume, muteopt)

Source:

Set the volume of the tone.

Parameters:
Name Type Attributes Default Description
volume Integer

the volume of the tone

mute boolean <optional>
false

whether or not to mute the tone

(abstract) stop()

Source:

Stop playing the sound immediately.