是否有将 wav 文件读入 short[] 数组的 api?我正在尝试将 wav 文件读入短数组。
我找不到任何内置的 API
我是遵循这个Java教程的初学程序员.
在Basic I/O部分中,提到的两个类是Data Streams和Object Streams.
它们非常类似地使用:
out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(dataFile)));
// ..
in = new DataInputStream(new BufferedInputStream(new FileInputStream(dataFile)));
Run Code Online (Sandbox Code Playgroud)
为DataInputStream和
out = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(dataFile)));
// ..
in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(dataFile)));
Run Code Online (Sandbox Code Playgroud)
对于 ObjectInputStream
我知道它说DataInputStreams用于原始对象,并ObjectInputStreams用于对象(和它们的序列化),所以我应该使用哪一个?两个使用原始类型的示例类之间没有明显的区别.我通常也使用原始类型.
对于性能,哪一个更好?还有其他大的差异吗?
谢谢.