# AudioEncoder

open class AudioEncoder : BaseEncoder, GetMicrophoneData

Created by pedro on 19/01/17. Encode PCM audio data to ACC and return in a callback

## Constructors

AudioEncoder
Link copied to clipboard
constructor(getAudioData: GetAudioData)

## Properties

inputSize
Link copied to clipboard
val inputSize: Int = 8192

## Functions

forceCodecType
Link copied to clipboard
open fun forceCodecType(codecType: CodecUtil.CodecType)
formatChanged
Link copied to clipboard
open fun formatChanged(@NonNull mediaCodec: MediaCodec, @NonNull mediaFormat: MediaFormat)
getType
Link copied to clipboard
open fun getType(): String
inputAvailable
Link copied to clipboard
open fun inputAvailable(@NonNull mediaCodec: MediaCodec, inBufferIndex: Int)
abstract fun inputAvailable(mediaCodec: MediaCodec, inBufferIndex: Int)
inputPCMData
Link copied to clipboard
open fun inputPCMData(@NonNull frame: Frame)
Set custom PCM data.
isRunning
Link copied to clipboard
open fun isRunning(): Boolean
outputAvailable
Link copied to clipboard
open fun outputAvailable(@NonNull mediaCodec: MediaCodec, outBufferIndex: Int, @NonNull bufferInfo: MediaCodec.BufferInfo)
abstract fun outputAvailable(mediaCodec: MediaCodec, outBufferIndex: Int, bufferInfo: MediaCodec.BufferInfo)
prepareAudioEncoder
Link copied to clipboard
open fun prepareAudioEncoder(): Boolean
Prepare encoder with default parameters
open fun prepareAudioEncoder(bitRate: Int, sampleRate: Int, isStereo: Boolean): Boolean
Prepare encoder with custom parameters
reset
Link copied to clipboard
open fun reset(): Boolean
restart
Link copied to clipboard
open fun restart()
setEncoderErrorCallback
Link copied to clipboard
open fun setEncoderErrorCallback(encoderErrorCallback: CodecErrorCallback)
setGetFrame
Link copied to clipboard
open fun setGetFrame(getFrame: GetFrame)
setSampleRate
Link copied to clipboard
open fun setSampleRate(sampleRate: Int)
setTimestampMode
Link copied to clipboard
open fun setTimestampMode(timestampMode: TimestampMode)
setType
Link copied to clipboard
open fun setType(type: String)
start
Link copied to clipboard
open fun start()
open fun start(startTs: Long)
open fun start(resetTs: Boolean)
stop
Link copied to clipboard
open fun stop()
open fun stop(resetTs: Boolean)