|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.audio.Recorder
public abstract class Recorder
| Nested Class Summary | |
|---|---|
static interface |
Recorder.Errors
Status values. |
| Field Summary | |
|---|---|
static int |
DEFAULT_MAX_RECORD_TIME
default max recording time. |
static boolean |
NO_TRIM
Constant used with stop(boolean) |
static boolean |
TRIM
Constant used with stop(boolean) |
| Constructor Summary | |
|---|---|
Recorder()
|
|
| Method Summary | |
|---|---|
abstract void |
abort()
|
abstract void |
destroy()
Deletes previous recording. |
abstract int |
getAvailableFileRecordSeconds(String volumePath,
int format,
int sampleRate,
int channels)
Return the available time in seconds that can be recorded to this volume given these record parameters. |
abstract int |
getCurrentDuration()
|
abstract byte[] |
getData()
Always return a Format.Type.WAV formatted file |
static Recorder |
getInstance()
return an instance of the Recorder class. |
abstract int |
getMaxDuration()
|
abstract int |
getRecordMonitorLevel()
|
abstract boolean |
isPaused()
|
abstract boolean |
isRecording()
|
abstract void |
pause()
|
abstract void |
resume()
|
abstract void |
setMaxDuration(int milliseconds)
|
int |
start()
Start recording audio to memory, formatted as Format.RecordType.WAV
at 8 kHz, monaural 16 bit. |
int |
start(File recordFile)
Start recording audio to SD card, formatted as Format.RecordType.WAV
at 22.05 kHz, monaural 16 bit. |
abstract int |
start(int format,
int sampleRate,
int channels)
Start recording to memory. |
abstract int |
start(String filePath,
int format,
int sampleRate,
int channels)
Record to SD card. |
void |
stop()
|
abstract void |
stop(boolean trim)
Stop recording. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_MAX_RECORD_TIME
public static final boolean TRIM
stop(boolean)
public static final boolean NO_TRIM
stop(boolean)
| Constructor Detail |
|---|
public Recorder()
| Method Detail |
|---|
public abstract void destroy()
getData() will return null. Does NOT destroy the Recorder object.
public static final Recorder getInstance()
throws AudioException
AudioException - if audio recording is not implemented.public int start()
Format.RecordType.WAV
at 8 kHz, monaural 16 bit.
Will destroy the previous recording, if there was one.
Recorder.Errorspublic int start(File recordFile)
Format.RecordType.WAV
at 22.05 kHz, monaural 16 bit.
recordFile - Path to output file.
Recorder.Errors
public abstract int start(int format,
int sampleRate,
int channels)
format - one of Format.RecordTypesampleRate - between 8000 and 44100channels - 1 or 2
Recorder.Errors
public abstract int getAvailableFileRecordSeconds(String volumePath,
int format,
int sampleRate,
int channels)
volumePath - - volume name including path (i.e. '/volumeName').format - - record encoding see Format.RecordType.sampleRate - - must be between 8 kHz and 44.1 kHz.channels - - currently only 1 is supported.
IllegalArgumentException - parameter values are invalid.
NullPointerException - if volumePath is null.
public abstract int start(String filePath,
int format,
int sampleRate,
int channels)
filePath - - full path to output file (i.e. '/volumeName/this/here/file').format - - record encoding see Format.RecordType.sampleRate - - must be between 8 kHz and 44.1 kHz.channels - - currently only 1 is supported.
NullPointerException - if filePath is null.public void stop()
public abstract void stop(boolean trim)
trim - - whether to trim the end of the recording. Use TRIM or
NO_TRIMpublic abstract void pause()
public abstract void resume()
public abstract void abort()
public abstract boolean isRecording()
public abstract boolean isPaused()
public abstract int getRecordMonitorLevel()
public abstract void setMaxDuration(int milliseconds)
public abstract int getMaxDuration()
public abstract int getCurrentDuration()
public abstract byte[] getData()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||