java合并两段音频成一段 同时播放类似伴奏
2020-11-16 11:27
阅读:820
标签:java 合并音频
/** * * @param partsPaths 要合成的音频路径数组 * @param unitedFilePath 输入合并结果数组 */ public void uniteWavFile(String[] partsPaths, String unitedFilePath) { byte byte1[] = getByte(partsPaths[0]); byte byte2[] = getByte(partsPaths[1]); byte[] out = new byte[byte1.length]; for (int i = 0; i > 1); try { FileOutputStream fos = new FileOutputStream(new File(unitedFilePath)); fos.write(out); fos.close(); } catch (Exception e) { e.printStackTrace(); } } private byte[] getByte(String path){ File f = new File(path); InputStream in; byte bytes[] = null; try { in = new FileInputStream(f); bytes = new byte[(int) f.length()]; in.read(bytes); in.close(); } catch (Exception e) { e.printStackTrace(); } return bytes; }
java合并两段音频成一段 同时播放类似伴奏,搜素材,soscw.com
java合并两段音频成一段 同时播放类似伴奏
标签:java 合并音频
原文地址:http://blog.csdn.net/qq634416025/article/details/24591991
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:java合并两段音频成一段 同时播放类似伴奏
文章链接:http://soscw.com/index.php/essay/21635.html
文章标题:java合并两段音频成一段 同时播放类似伴奏
文章链接:http://soscw.com/index.php/essay/21635.html
评论
亲,登录后才可以留言!