-
public class AudioConfigAudio configuration to be passed as input to the constructor of an AudioMediaEncoder.
-
-
Field Summary
Fields Modifier and Type Field Description public intbitRatepublic intchannelspublic Stringencoderpublic StringmimeTypepublic intsamplingFrequencyfinal intencodingfinal intsampleSizePerChannelfinal intbyteRatePerChannel
-
Method Summary
Modifier and Type Method Description AudioConfigcopy()intbyteRate()intbitRate()intaudioFormatChannels()intframeSize()We call FRAME here the chunk of data that we want to read at each loop cycle.When this number is HIGH, the AudioRecord might be unable to keep a good pace andwe might end up skip some frames.When this number is LOW, we pull a bigger number of frames and this might end updelaying our recorder/encoder balance (more frames means more encoding operations).In the end, this means that the recorder will skip some frames to restore the balance. intaudioRecordBufferFrames()Number of frames contained in the android.media.AudioRecord buffer.In theory, the higher this value is, the safer it is to delay reading as theaudioRecord will hold the recorded samples anyway and return to us next time we read. intbufferPoolMaxSize()We allocate buffers of frameSize each, which is not much.This value indicates the maximum number of these buffers that we can allocate at a giveninstant. -
-
Method Detail
-
copy
@NonNull() AudioConfig copy()
-
byteRate
int byteRate()
-
bitRate
int bitRate()
-
audioFormatChannels
int audioFormatChannels()
-
frameSize
int frameSize()
We call FRAME here the chunk of data that we want to read at each loop cycle.When this number is HIGH, the AudioRecord might be unable to keep a good pace andwe might end up skip some frames.When this number is LOW, we pull a bigger number of frames and this might end updelaying our recorder/encoder balance (more frames means more encoding operations).In the end, this means that the recorder will skip some frames to restore the balance.
-
audioRecordBufferFrames
int audioRecordBufferFrames()
Number of frames contained in the android.media.AudioRecord buffer.In theory, the higher this value is, the safer it is to delay reading as theaudioRecord will hold the recorded samples anyway and return to us next time we read.Should be coordinated with frameSize.
-
bufferPoolMaxSize
int bufferPoolMaxSize()
We allocate buffers of frameSize each, which is not much.This value indicates the maximum number of these buffers that we can allocate at a giveninstant. This value is the number of runnables that the encoder thread is allowed to be'behind' the recorder thread. It's not safe to have it very large or we can end encodingA LOT AFTER the actual recording. It's better to reduce this and skip recording at all.Should be coordinated with frameSize.
-
-
-
-