APIdia Launch Partner
Top Description Constructors Methods
com.badlogic.gdx.backends.headless.mock.audio

public Class MockSound

extends Object
implements Sound
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.audio.Sound, com.badlogic.gdx.utils.Disposable
Imports
com.badlogic.gdx.audio.Sound

The headless backend does its best to mock elements. This is intended to make code-sharing between server and client as simple as possible.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Implements com.badlogic.gdx.audio.Sound.dispose.

Releases all the resources.

public long
loop()

Implements com.badlogic.gdx.audio.Sound.loop.

Plays the sound, looping.

public long
loop(float volume)

Implements com.badlogic.gdx.audio.Sound.loop.

Plays the sound, looping.

public long
loop(float volume, float pitch, float pan)

Implements com.badlogic.gdx.audio.Sound.loop.

Plays the sound, looping.

public void
pause()

Implements com.badlogic.gdx.audio.Sound.pause.

Pauses all instances of this sound.

public void
pause(long soundId)

Implements com.badlogic.gdx.audio.Sound.pause.

Pauses the sound instance with the given id as returned by play() or play(float).

public long
play()

Implements com.badlogic.gdx.audio.Sound.play.

Plays the sound.

public long
play(float volume)

Implements com.badlogic.gdx.audio.Sound.play.

Plays the sound.

public long
play(float volume, float pitch, float pan)

Implements com.badlogic.gdx.audio.Sound.play.

Plays the sound.

public void
resume()

Implements com.badlogic.gdx.audio.Sound.resume.

Resumes all paused instances of this sound.

public void
resume(long soundId)

Implements com.badlogic.gdx.audio.Sound.resume.

Resumes the sound instance with the given id as returned by play() or play(float).

public void
setLooping(long soundId, boolean looping)

Implements com.badlogic.gdx.audio.Sound.setLooping.

Sets the sound instance with the given id to be looping.

public void
setPan(long soundId, float pan, float volume)

Implements com.badlogic.gdx.audio.Sound.setPan.

Sets the panning and volume of the sound instance with the given id as returned by play() or play(float).

public void
setPitch(long soundId, float pitch)

Implements com.badlogic.gdx.audio.Sound.setPitch.

Changes the pitch multiplier of the sound instance with the given id as returned by play() or play(float).

public void
setVolume(long soundId, float volume)

Implements com.badlogic.gdx.audio.Sound.setVolume.

Changes the volume of the sound instance with the given id as returned by play() or play(float).

public void
stop()

Implements com.badlogic.gdx.audio.Sound.stop.

Stops playing all instances of this sound.

public void
stop(long soundId)

Implements com.badlogic.gdx.audio.Sound.stop.

Stops the sound instance with the given id as returned by play() or play(float).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MockSoundback to summary
public MockSound()

Method Detail

disposeback to summary
public void dispose()

Implements com.badlogic.gdx.audio.Sound.dispose.

Doc from com.badlogic.gdx.audio.Sound.dispose.

Releases all the resources.

Annotations
@Override
loopback to summary
public long loop()

Implements com.badlogic.gdx.audio.Sound.loop.

Doc from com.badlogic.gdx.audio.Sound.loop.

Plays the sound, looping. If the sound is already playing, it will be played again, concurrently.

Annotations
@Override
loopback to summary
public long loop(float volume)

Implements com.badlogic.gdx.audio.Sound.loop.

Doc from com.badlogic.gdx.audio.Sound.loop.

Plays the sound, looping. If the sound is already playing, it will be played again, concurrently. You need to stop the sound via a call to stop(long) using the returned id.

Annotations
@Override
loopback to summary
public long loop(float volume, float pitch, float pan)

Implements com.badlogic.gdx.audio.Sound.loop.

Doc from com.badlogic.gdx.audio.Sound.loop.

Plays the sound, looping. If the sound is already playing, it will be played again, concurrently. You need to stop the sound via a call to stop(long) using the returned id. Note that (with the exception of the web backend) panning only works for mono sounds, not for stereo sounds!

Annotations
@Override
pauseback to summary
public void pause()

Implements com.badlogic.gdx.audio.Sound.pause.

Doc from com.badlogic.gdx.audio.Sound.pause.

Pauses all instances of this sound.

Annotations
@Override
pauseback to summary
public void pause(long soundId)

Implements com.badlogic.gdx.audio.Sound.pause.

Doc from com.badlogic.gdx.audio.Sound.pause.

Pauses the sound instance with the given id as returned by play() or play(float). If the sound is no longer playing, this has no effect.

Annotations
@Override
playback to summary
public long play()

Implements com.badlogic.gdx.audio.Sound.play.

Doc from com.badlogic.gdx.audio.Sound.play.

Plays the sound. If the sound is already playing, it will be played again, concurrently.

Annotations
@Override
playback to summary
public long play(float volume)

Implements com.badlogic.gdx.audio.Sound.play.

Doc from com.badlogic.gdx.audio.Sound.play.

Plays the sound. If the sound is already playing, it will be played again, concurrently.

Annotations
@Override
playback to summary
public long play(float volume, float pitch, float pan)

Implements com.badlogic.gdx.audio.Sound.play.

Doc from com.badlogic.gdx.audio.Sound.play.

Plays the sound. If the sound is already playing, it will be played again, concurrently. Note that (with the exception of the web backend) panning only works for mono sounds, not for stereo sounds!

Annotations
@Override
resumeback to summary
public void resume()

Implements com.badlogic.gdx.audio.Sound.resume.

Doc from com.badlogic.gdx.audio.Sound.resume.

Resumes all paused instances of this sound.

Annotations
@Override
resumeback to summary
public void resume(long soundId)

Implements com.badlogic.gdx.audio.Sound.resume.

Doc from com.badlogic.gdx.audio.Sound.resume.

Resumes the sound instance with the given id as returned by play() or play(float). If the sound is not paused, this has no effect.

Annotations
@Override
setLoopingback to summary
public void setLooping(long soundId, boolean looping)

Implements com.badlogic.gdx.audio.Sound.setLooping.

Doc from com.badlogic.gdx.audio.Sound.setLooping.

Sets the sound instance with the given id to be looping. If the sound is no longer playing this has no effect.s

Annotations
@Override
setPanback to summary
public void setPan(long soundId, float pan, float volume)

Implements com.badlogic.gdx.audio.Sound.setPan.

Doc from com.badlogic.gdx.audio.Sound.setPan.

Sets the panning and volume of the sound instance with the given id as returned by play() or play(float). If the sound is no longer playing, this has no effect. Note that panning only works for mono sounds, not for stereo sounds!

Annotations
@Override
setPitchback to summary
public void setPitch(long soundId, float pitch)

Implements com.badlogic.gdx.audio.Sound.setPitch.

Doc from com.badlogic.gdx.audio.Sound.setPitch.

Changes the pitch multiplier of the sound instance with the given id as returned by play() or play(float). If the sound is no longer playing, this has no effect.

Annotations
@Override
setVolumeback to summary
public void setVolume(long soundId, float volume)

Implements com.badlogic.gdx.audio.Sound.setVolume.

Doc from com.badlogic.gdx.audio.Sound.setVolume.

Changes the volume of the sound instance with the given id as returned by play() or play(float). If the sound is no longer playing, this has no effect.

Annotations
@Override
stopback to summary
public void stop()

Implements com.badlogic.gdx.audio.Sound.stop.

Doc from com.badlogic.gdx.audio.Sound.stop.

Stops playing all instances of this sound.

Annotations
@Override
stopback to summary
public void stop(long soundId)

Implements com.badlogic.gdx.audio.Sound.stop.

Doc from com.badlogic.gdx.audio.Sound.stop.

Stops the sound instance with the given id as returned by play() or play(float). If the sound is no longer playing, this has no effect.

Annotations
@Override