JSStreamingSampleRecorder.java 文件源码

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

项目:romanov 作者:
/**
 * Finishes the recording process by closing the file.
 */
public AudioRecordingStream save()
{
  try
  {
    aos.close();
  }
  catch (IOException e)
  {
    Minim.error("AudioRecorder.save: An error occurred when trying to save the file:\n"
                + e.getMessage());
  }
  String filePath = filePath();
  AudioInputStream ais = system.getAudioInputStream(filePath);
  SourceDataLine sdl = system.getSourceDataLine(ais.getFormat(), 1024);
  // this is fine because the recording will always be 
  // in a raw format (WAV, AU, etc).
  long length = AudioUtils.frames2Millis(ais.getFrameLength(), format);
  BasicMetaData meta = new BasicMetaData(filePath, length, ais.getFrameLength());
  JSPCMAudioRecordingStream recording = new JSPCMAudioRecordingStream(system, meta, ais, sdl, 1024);
  return recording;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号