public class AudioRecordManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
SAMPLE_RATE_16000 |
static int |
SAMPLE_RATE_44100 |
| Constructor and Description |
|---|
AudioRecordManager() |
| Modifier and Type | Method and Description |
|---|---|
static void |
convert441To16(short[] from,
byte[] to)
Convert audio sample rate from 44100 to 16000.
|
static AudioRecordManager |
create()
Create a KeepRecordingSpeechRecognizer instance by a specified speech recognizer.
|
static int |
getAudioChannelConfig()
Get the normal supported audio channel setting
|
static int |
getAudioFormatConfig()
Get the normal supported audio data encoding
|
android.media.AudioRecord |
getAudioRecord()
Get AudioRecord.
|
static int |
getSampleRateConfig()
Get the normal supported sample rate
|
void |
startRecording()
Enable microphone then start the voice recording.
|
void |
stopAndRelease()
Stop and release resource.
|
public static final int SAMPLE_RATE_44100
public static final int SAMPLE_RATE_16000
public static AudioRecordManager create() throws java.lang.Exception
java.lang.Exceptionpublic static void convert441To16(short[] from,
byte[] to)
from - - Source buffer.to - - Target buffer.public android.media.AudioRecord getAudioRecord()
public void startRecording()
throws java.lang.Exception
java.lang.Exception - There is something wrong.public static int getSampleRateConfig()
public static int getAudioChannelConfig()
public static int getAudioFormatConfig()
public void stopAndRelease()