问题
I am trying to build a video system. I get the data from Camera through Preview, then I give the data to Mediacodec and let it do the video encoding job. Now I am focus on the audio part. I am not sure which API to use for the audio caperture and audio encoding.
I've done some search. But it seems that most of the demos use MediaRecord. Since I've replaced the MediaRecord with MediaCodec, I think I need to find some new way to do the audio part. How to capeture the audio? Can MediaCodec do audio codec?
Thank You!
回答1:
Yes. The MediaMuxerTest demonstrates using two MediaCodec
encoder instances (one for audio, one for video) and MediaMuxer
to "clone" a movie file.
Note the audio/mp4a-latm
MIME type is used for audio.
来源:https://stackoverflow.com/questions/20835655/does-mediacodec-in-android-support-audio-encodec