JSStreamingSampleRecorder.java 文件源码

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

项目:romanov 作者:
/**
 * 
 * @param fileName
 * @param fileType
 * @param fileFormat
 */
JSStreamingSampleRecorder(JSMinim sys, 
                       String fileName, 
                       AudioFileFormat.Type fileType, 
                       AudioFormat fileFormat,
                       int bufferSize)
{
  name = fileName;
  type = fileType;
  format = fileFormat;
  system = sys;
  try
  {
    aos = AudioSystemShadow.getAudioOutputStream( type, format,
                            AudioSystem.NOT_SPECIFIED, 
                            new File(name) );
  }
  catch (IOException e)
  {
    system.error("Error obtaining new output stream: " + e.getMessage());
  }
  catch (IllegalArgumentException badarg)
  {
    system.error("Error obtaining new output stream for " + fileName + " with type " 
        + type.toString() + " format " + format.toString() 
        + " and bufferSize " + bufferSize + ".\n" 
        + "The reason is " + badarg.getMessage());
  }
  fsb = new FloatSampleBuffer(format.getChannels(),
                              bufferSize,
                              format.getSampleRate());
  recording = false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号