我曾尝试编写播放声音文件的程序但到目前为止都没有成功.我无法理解代码的某些部分:
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
Run Code Online (Sandbox Code Playgroud)
AudioFormat
我如何才能知道采样率,文件大小,通道是什么,以及最后的2个布尔变量?length
)的值?