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

public Class MockAudioDevice

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

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.AudioDevice.dispose.

Frees all resources associated with this AudioDevice.

public int
public boolean
public void
pause()

Implements com.badlogic.gdx.audio.AudioDevice.pause.

Pauses the audio device if supported

public void
resume()

Implements com.badlogic.gdx.audio.AudioDevice.resume.

Unpauses the audio device if supported

public void
setVolume(float volume)

Implements com.badlogic.gdx.audio.AudioDevice.setVolume.

Sets the volume in the range [0,1].

public void
writeSamples(short[] samples, int offset, int numSamples)

Implements com.badlogic.gdx.audio.AudioDevice.writeSamples.

Writes the array of 16-bit signed PCM samples to the audio device and blocks until they have been processed.

public void
writeSamples(float[] samples, int offset, int numSamples)

Implements com.badlogic.gdx.audio.AudioDevice.writeSamples.

Writes the array of float PCM samples to the audio device and blocks until they have been processed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MockAudioDeviceback to summary
public MockAudioDevice()

Method Detail

disposeback to summary
public void dispose()

Implements com.badlogic.gdx.audio.AudioDevice.dispose.

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

Frees all resources associated with this AudioDevice. Needs to be called when the device is no longer needed.

Annotations
@Override
getLatencyback to summary
public int getLatency()

Implements com.badlogic.gdx.audio.AudioDevice.getLatency.

Annotations
@Override
isMonoback to summary
public boolean isMono()

Implements com.badlogic.gdx.audio.AudioDevice.isMono.

Annotations
@Override
pauseback to summary
public void pause()

Implements com.badlogic.gdx.audio.AudioDevice.pause.

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

Pauses the audio device if supported

Annotations
@Override
resumeback to summary
public void resume()

Implements com.badlogic.gdx.audio.AudioDevice.resume.

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

Unpauses the audio device if supported

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

Implements com.badlogic.gdx.audio.AudioDevice.setVolume.

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

Sets the volume in the range [0,1].

Annotations
@Override
writeSamplesback to summary
public void writeSamples(short[] samples, int offset, int numSamples)

Implements com.badlogic.gdx.audio.AudioDevice.writeSamples.

Doc from com.badlogic.gdx.audio.AudioDevice.writeSamples.

Writes the array of 16-bit signed PCM samples to the audio device and blocks until they have been processed.

Annotations
@Override
writeSamplesback to summary
public void writeSamples(float[] samples, int offset, int numSamples)

Implements com.badlogic.gdx.audio.AudioDevice.writeSamples.

Doc from com.badlogic.gdx.audio.AudioDevice.writeSamples.

Writes the array of float PCM samples to the audio device and blocks until they have been processed.

Annotations
@Override