APIdia Launch Partner
Top Description Methods
com.badlogic.gdx.audio

public Interface AudioRecorder

extends Disposable
Imports
com.badlogic.gdx.utils.Disposable

An AudioRecorder allows to record input from an audio device. It has a sampling rate and is either stereo or mono. Samples are returned in signed 16-bit PCM format. Stereo samples are interleaved in the order left channel, right channel. The AudioRecorder has to be disposed if no longer needed via the dispose().
Author
mzechner

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Redeclares com.badlogic.gdx.utils.Disposable.dispose.

Disposes the AudioRecorder

public void
read(short[]
the array to write the samples to
samples
,
int
the offset into the array
offset
,
int
the number of samples to be read
numSamples
)

Reads in numSamples samples into the array samples starting at offset.

Method Detail

disposeback to summary
public void dispose()

Redeclares com.badlogic.gdx.utils.Disposable.dispose.

Disposes the AudioRecorder

readback to summary
public void read(short[] samples, int offset, int numSamples)

Reads in numSamples samples into the array samples starting at offset. If the recorder is in stereo you have to multiply numSamples by 2.

Parameters
samples:short[]

the array to write the samples to

offset:int

the offset into the array

numSamples:int

the number of samples to be read