【发布时间】:2014-10-14 13:41:47
【问题描述】:
我看了几页,但我找到了问题的解决方案,想将两个mp3曲目合二为一,但当时他写输出(juntos4.mp3,只是歌曲,有人可以帮帮我吗?
“我的”代码...
FileInputStream fis1 = new FileInputStream("/sdcard/1408586436107.mp3"); // first source file
FileInputStream fis2 = new FileInputStream("/sdcard/1408586281745.mp3");//second source file
SequenceInputStream sis = new SequenceInputStream(fis1, fis2);
FileOutputStream fos = new FileOutputStream("/sdcard/juntos4.mp3");//destinationfile
int temp;
try {
while ((temp = sis.read())!= -1){
fos.write(temp);
}
fis1.close();
fis2.close();
sis.close();
fos.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
【问题讨论】:
-
你到底想要什么?
-
将两个文件 mp3(音乐)合并到一个唯一的文件中,包含两个 mp3 文件...
-
你现在得到什么输出?
-
@DiogoOdelli 检查答案
-
只是第一首曲目...FileInputStream fis1 = new FileInputStream("/sdcard/1408586436107.mp3"); // 第一个源文件...
标签: java android join mp3 output