AudioFormat对象
sampleRate 采样率 每秒音频采样数量
sampleSizeInBits 采样位数 每个采样的位数
channels 声道 1: Mono 单声道,2:Stereo 立体
signed 有符号无符号
bigEndian 大端模式存储 还是小端模式存储
采集麦克风音频
AudioFormat audioFormat = new AudioFormat(16000.0F, 16, 1, true, false);
DataLine.Info info = new DataLine.Info(TargetDataLine.class, audioFormat);
TargetDataLine targetDataLine = (TargetDataLine)AudioSystem.getLine(info);
targetDataLine.open(audioFormat);
targetDataLine.start();
System.out.println("You can speak now!");
int nByte = 0;
final int bufSize = 3200;
byte[] buffer = new byte[bufSize];
while ((nByte = targetDataLine.read(buffer, 0, bufSize)) >