I have an audio file that is stored on an SD card, I want to add audio to the end of this file, the ways that I found how to do it is using SequenceInputStream or ffmpeg. Are there any other options how to do this?

    1 answer 1

    If this is not a coded, “raw” audio file wav , pcm , then you can add it using AudioRecord from android sdk.

    If encoded, then to finish it is necessary to decode everything, add and encode again. If you do this on the android, then you can use MediaCodec api , it depends on the codec, you have to watch which one it supports. True, there are few examples on the net, and I didn’t figure it out in my time.

    Another option, more simple - ffmpeg . Here you can shove a binary ffmpega into the application and work as from the command line. Or use the javaCV library. A good example of using RecordActivity.java .

    Encoding / decoding via ffmpeg on android slowly works, so in due time I did all sorts of media projects on the project through it, but on the server.