AudioCapture.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:myrobotlab 作者:
public void captureAudio() {
  try {
    // Get everything set up for
    // capture
    audioFormat = getAudioFormat();
    DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class, audioFormat);
    targetDataLine = (TargetDataLine) AudioSystem.getLine(dataLineInfo);
    targetDataLine.open(audioFormat);
    targetDataLine.start();

    // Create a thread to capture the
    // microphone data and start it
    // running. It will run until
    // the Stop button is clicked.
    Thread captureThread = new Thread(new CaptureThread());
    captureThread.start();
  } catch (Exception e) {
    Logging.logError(e);
  } 
  broadcastState();
  // end catch
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号