开发者

Merge multiple audio files into a single file

I want to merge audio files into a single file and then play that file. I have tried number of ways ...

playedFilesSequenceList is the arraylist which has audio files from the R.raw folder.

for(int k=0; k<playedFilesSequenceList.size();k++) {
    InputStream inputStream = getResources().openRawResource(playe开发者_如何学编程dFilesSequenceList.get(k));
    try {
        int size = inputStream.available();
        byte []buffer = new byte[size];
        inputStream.read(buffer);
        //File destination = new File(getFilesDir(),"mycopy.wav");
        fos.write(buffer);
    } catch(Exception e) {
        e.printStackTrace();
    }
    //readFile(inputStream,destination);
    try {
        inputStream.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜