视频录制——4.录制音频

AudioRecorder

Builder模式创建实例

// source:音源类型。DEFAULT默认;MIC话筒;VOICE_UPLINK通话上行;VOICE_DOWNLINK通话下行;VOICE_CALL通话
//                上行加下行;CAMCORDER与摄像头同向的麦克风音源;VOICE_RECOGNITION;VOICE_COMMUNICATION
public Builder setAudioSource(int source)

// format:音源格式
public Builder setAudioFormat(@NonNull AudioFormat format)

// bufferSizeInBytes:缓冲区大小,可由getMinBufferSize(int, int, int)得到
public Builder setBufferSizeInBytes(int bufferSizeInBytes)

// 开始录音
public void startRecording()

AudioFormat

三个指标:
Sample rate(44100)
Encoding(ENCODING_PCM_16BIT)
Channel mask(CHANNEL_OUT_FRONT_CENTER)

你可能感兴趣的:(视频录制——4.录制音频)