我已經嘗試編寫播放聲音文件但迄今未成功的程序。 我無法理解代碼的某些部分:瞭解AudioFormat,AudioInputStream和啓動方法的構造函數
InputStream is = new FileInputStream("sound file");
AudioFormat af = new AudioFormat(float sampleRate, int sampleSizeInBits, int channels, boolean signed, boolean bigEndian); // I don't understand it's constructor
long length ; // length in sample frames
// how cani i know the length of frames ?
AudioInputStream ais = new AudioInputStream(is , af , length);
// open (ais);
// start playing by invoking start method
- 在
AudioFormat
我怎麼能知道採樣率,提前文件大小,什麼是渠道的構造,並在2個布爾變量結束? - 如何獲得樣本框的值(
length
)? - 另外我該如何調用啓動方法?我不希望從任何線,但該文件中的數據的文件夾中保持(即,剪輯)
什麼是小端,大端? 8與16有什麼不同? –
提示:在'ClassName + 6'上搜索通常會引導您使用Java 6 JavaDocs(如果它是泛型類名稱,例如'Thread',則可以將'javadoc'添加到搜索中)。 –
[Endianness](http://en.wikipedia.org/wiki/Endianness) – James