public abstract class SoundRecorder extends SFMLNativeObject
| Modifier | Constructor and Description |
|---|---|
protected |
SoundRecorder()
Constructs a sound recorder.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getSampleRate()
Gets the sample rate that audio is being captured with.
|
static boolean |
isAvailable()
Checks whether audio capturing is available on this system.
|
protected long |
nativeCreate()
Deprecated.
|
protected void |
nativeDelete()
Deprecated.
|
protected void |
nativeSetExPtr()
Deprecated.
|
protected abstract boolean |
onProcessSamples(short[] samples)
Called when a new batch of audio samples comes in.
|
protected abstract boolean |
onStart()
Called when the sound recorder starts recording.
|
protected abstract void |
onStop()
Called when the audio capture has stopped.
|
void |
start()
Starts capturing audio data with a sample rate of 44,100 Hz.
|
void |
start(int sampleRate)
Starts capturing audio data with the specified sample rate.
|
void |
stop()
Stops capturing audio data.
|
finalizepublic static boolean isAvailable()
true if audio capturing is available, false otherwise.@Deprecated protected long nativeCreate()
SFMLNativeObjectnativeCreate in class SFMLNativeObject@Deprecated protected void nativeSetExPtr()
SFMLNativeObjectnativeSetExPtr in class SFMLNativeObject@Deprecated protected void nativeDelete()
SFMLNativeObjectnativeDelete in class SFMLNativeObjectpublic final void start(int sampleRate)
sampleRate - the sample rate in samples per second.public final void start()
public final void stop()
public final int getSampleRate()
protected abstract boolean onStart()
true to start recording after this method is done, false to cancel.protected abstract boolean onProcessSamples(short[] samples)
samples - the 16-bit mono samples that were captured.true to continue recording after this method is done, false
to stop recording.protected abstract void onStop()