Java android.media AudioRecord fields, constructors, methods, implement or subclass

Example usage for Java android.media AudioRecord fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.media AudioRecord.

The text is from its open source code.

Field

intSTATE_INITIALIZED
indicates AudioRecord state is ready to be used
intRECORDSTATE_STOPPED
indicates AudioRecord recording state is not recording
intERROR
Denotes a generic operation failure.
intERROR_BAD_VALUE
Denotes a failure due to the use of an invalid value.
intERROR_INVALID_OPERATION
Denotes a failure due to the improper use of a method.

Constructor

Method

intgetAudioSource()
Returns the audio recording source.
intgetMinBufferSize(int sampleRateInHz, int channelConfig, int audioFormat)
Returns the minimum buffer size required for the successful creation of an AudioRecord object, in byte units.
intgetState()
Returns the state of the AudioRecord instance.
intread(@NonNull byte[] audioData, int offsetInBytes, int sizeInBytes)
Reads audio data from the audio hardware for recording into a byte array.
intread(@NonNull short[] audioData, int offsetInShorts, int sizeInShorts)
Reads audio data from the audio hardware for recording into a short array.
intread(@NonNull ByteBuffer audioBuffer, int sizeInBytes, @ReadMode int readMode)
Reads audio data from the audio hardware for recording into a direct buffer.
voidrelease()
Releases the native AudioRecord resources.
voidstartRecording()
Starts recording from the AudioRecord instance.
voidstop()
Stops recording.