如何在java中从字节数组写入WAV文件?
我想从字节数组写入 Wav 文件,并且还想从输入 wav 文件中分割通道
Java Sound API 显示您可以从 TargetDataLine 录制音乐,并作为示例显示数据被写入字节数组。但是将此字节数组写入自己的文件中是相当无用的,因为它不是 WAV 文件格式并且无法在其他应用程序中播放。
如何使用 javax.sound.sampled 包编写声音文件?
I would like to write the Wav file from byte array and I also want to split channels from the input wav file
The Java Sound API shows that you can record music from a TargetDataLine and as an example shows the data being written to a byte array. But writing this byte array out into its own file is fairly useless since it is not in the WAV file format and cannot be played in other applications.
How do I write sound files using the javax.sound.sampled package?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我过去曾用过这个来从 Wav -> byte[] 和 byte[] ->波形
I have used this in the past for going from Wav -> byte[] and byte[] -> Wav
通过读取字节将文件从
InputStream
写入OutputStream
:这里有一些已经回答的有关分割 wav 通道的问题,可能有用:
Writing file from
InputStream
toOutputStream
by reading bytes:And here are some already answered questions on splitting wav channels, may be of use: