I want to develop an android application which can record a video (mp4), then I have some audio files (mp3) in my resources folder, and I want to add it to the end of the video. So the final effect will be like first the video is played and at the end of video the added audio will be heard. how can I do it?
Open your Android Studio and create a new project. Create a new folder named "raw" in your Android project's "res" folder and place your audio file inside the "raw" folder. You can see the audio is now successfully added into your Android Studio project by viewing the "raw" subfolder under "res" folder.
Combing to files with different audio codecs is not easily possible. I would do the following:
Full disclosure: I am the maintainer of mp4parser.
After api version 18 android MediaCodec apis supports to access the low level api. MediaMuxer muxing the elementary streams.
https://developer.android.com/reference/android/media/MediaMuxer.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With