/**
* Implementation of the abstract start() method from DataStream
*/
public void start() throws Exception {
if (queue != null) { throw new Exception("ERROR in AudioStream.start(): LinkedBlockingQueue object is not null"); }
// Make sure we can open the audio line
try {
format = getFormat();
DataLine.Info info = new DataLine.Info(TargetDataLine.class, format);
line = (TargetDataLine) AudioSystem.getLine(info);
line.open(format);
line.start();
} catch (LineUnavailableException e) {
throw new Exception("Audio stream error, could not open the audio line:\n" + e.getMessage());
}
bIsRunning = true;
// Make sure there is no other audio capture running
stopAudio();
queue = new LinkedBlockingQueue<TimeValue>();
// start the audio capture
audioThread = new Thread(this);
audioThread.start();
updatePreview();
}
AudioStream.java 文件源码
java
阅读 46
收藏 0
点赞 0
评论 0
项目:cloudturbine
作者:
评论列表
文章目录