Android Programming Press on the image to return to the main documentation page.

AudioRecorder

Written by XverhelstX

List of types:

AudioRecorder

AudioRecorder


Permissions:

android.permission.WRITE_EXTERNAL_STORAGE
android.permission.RECORD_AUDIO

Events:

None

Members:


  AE_AAC As Int

  AE_AMR_NB As Int

  AE_AMR_WB As Int

  AE_DEFAULT As Int

  AS_CAMCORDER As Int

  AS_DEFAULT As Int

  AS_MIC As Int

  AS_VOICE_CALL As Int

  AS_VOICE_COMMUNICATION As Int

  AS_VOICE_DOWNLINK As Int

  AS_VOICE_RECOGNITION As Int

  AS_VOICE_UPLINK As Int

  AudioChannels As Int [write only]

  AudioEncoder As Int [write only]

  AudioEncodingBitRate As Int [write only]

  AudioMaxAmplitude As Int [read only]

  AudioSamplingRate As Int [write only]

  AudioSource As Int [write only]

  AudioSourceMax As Int [read only]

  Initialize

  isRecording As Boolean

  MaxDuration As Int [write only]

  MaxFileSize As Long [write only]

  OF_AMR_NB As Int

  OF_AMR_WB As Int

  OF_DEFAULT As Int

  OF_MPEG_4 As Int

  OF_RAW_AMR As Int

  OF_THREE_GPP As Int

  OutputFormat As Int [write only]

  prepare

  setOutputFile (Dir As String, Filename As String)

  start

  stop

Members description:

AE_AAC As Int
AE_AMR_NB As Int
AE_AMR_WB As Int
AE_DEFAULT As Int
AS_CAMCORDER As Int
AS_DEFAULT As Int
AS_MIC As Int
AS_VOICE_CALL As Int
AS_VOICE_COMMUNICATION As Int
AS_VOICE_DOWNLINK As Int
AS_VOICE_RECOGNITION As Int
AS_VOICE_UPLINK As Int
AudioChannels As Int [write only]
Sets the number of audio channels for recording.
Call this method before prepare().
Prepare() may perform additional checks on the parameter to make sure whether the specified number of audio channels are applicable.
API Level 8
AudioEncoder As Int [write only]
Sets the audio encoder to be used for recording.
If this method is not called, the output file will not contain an audio track.
Call this after setOutputFormat() but before prepare().
AudioEncodingBitRate As Int [write only]
Sets the audio encoding bit rate for recording.
API Level 8
Call this method before prepare().
Prepare() may perform additional checks on the parameter to make sure whether the specified bit rate is applicable,
and sometimes the passed bitRate will be clipped internally to ensure the audio recording can proceed smoothly based
on the capabilities of the platform.
AudioMaxAmplitude As Int [read only]
Gets the maximum amplitude.
AudioSamplingRate As Int [write only]
Sets the audio sampling rate for recording.
Call this method before prepare().
API Level 8
Prepare() may perform additional checks on the parameter to make sure whether the specified audio sampling rate is applicable.
The sampling rate really depends on the format for the audio recording, as well as the capabilities of the platform.
For instance, the sampling rate supported by AAC audio coding standard ranges from 8 to 96 kHz, the sampling
rate supported by AMRNB is 8kHz, and the sampling rate supported by AMRWB is 16kHz. Please consult with the related audio coding
standard for the supported audio sampling rate.
AudioSource As Int [write only]
Sets the audio source to be used for recording.
If this method is not called, the output file will not contain an audio track.
The source needs to be specified before setting recording-parameters or encoders.
Call this only before setOutputFormat().
AudioSourceMax As Int [read only]
Gets the maximum value for audio sources.
Initialize
Initializes AudioRecorder Library.
isRecording As Boolean
Returns a boolean with true if the recorder is currently recording.
Return type: @return:
MaxDuration As Int [write only]
Sets the maximum duration (in ms) of the recording session.
Call this after setOutFormat() but before prepare().
MaxFileSize As Long [write only]
Sets the maximum filesize (in bytes) of the recording session.
Call this after setOutFormat() but before prepare().
OF_AMR_NB As Int
OF_AMR_WB As Int
OF_DEFAULT As Int
OF_MPEG_4 As Int
OF_RAW_AMR As Int
OF_THREE_GPP As Int
OutputFormat As Int [write only]
Sets the format of the output file produced during recording.
Call this after setAudioSource()/setVideoSource() but before prepare().
It is recommended to always use 3GP format when using the H.263 video encoder and AMR audio encoder.
Using an MPEG-4 container format may confuse some desktop players.
prepare
Prepares the recorder to begin capturing and encoding data.
This method must be called after setting up the desired audio and video sources, encoders, file format, etc., but before start().
setOutputFile (Dir As String, Filename As String)
Sets the path of the output file to be produced.
Call this after setOutputFormat() but before prepare().
Dir: The pathname to the directory
Filename: The filename you wish to save for.
start
Begins capturing and encoding data to the file specified with setOutputFile().
Call this after prepare().
stop
Stops recording.
Call this after start().
Once recording is stopped, you will have to configure it again as if it has just been constructed.
Top