java合并两段音频成一段 同时播放类似伴奏
来源:互联网 发布:百视通软件德庆百事通 编辑:程序博客网 时间:2024/04/29 20:26
/** * * @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 < byte1.length; i++)out[i] = (byte) ((byte1[i] + byte2[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;}
0 0
- java合并两段音频成一段 同时播放类似伴奏
- ios同时播放两种音频,
- avfoundation 视频合成 ,合成两段视频和一段音频
- 同时播放两首歌曲
- 使用SoundPool 同时播放多个音频
- Java AudioClip播放音频
- java 播放音频
- java音频播放
- Java音频播放
- java 播放音频
- Java 音频播放
- Java-播放WAV音频
- Android播放音频的两种方式
- Android播放音频的两种方式
- C#同时播放两首音乐
- C#同时播放两首音乐
- 用Java实现音频播放
- 用Java实现音频播放
- 【linux】 UBUNTU下eclipse c/c++ 环境的安装
- Extjs 4.2 设置buttontext为中文
- linux下的开源移动图像监测程序--motion编译与配置及ffmpeg
- ExtJS 4.2.1学习笔记(二)——主题theme
- java中的HashTable,HashMap和HashSet
- java合并两段音频成一段 同时播放类似伴奏
- Sybase ASE 临时表
- 关于找不到类org/apache/commons/lang/xwork/StringUtils的问题
- C# Ping 简单使用
- orcad中的警告Warning [ALG0016] Part Name 《》 is renamed to 《》解决
- 有多个git项目要用多个秘钥
- 我的好奇,由于我的纵容、乐意冒险
- MFC概述
- 黑马程序员 面向对象(上) 封住,继承,多态,以及this和super的用法