示例#1
0
文件: AudioADX.cs 项目: Casidi/GARbro
 public AdxInput(Stream file, byte[] header)
     : base(file)
 {
     m_reader = new AdxReader (file, header);
     m_data_offset = 4 + header.Length;
     this.Format = m_reader.Format;
     this.PcmSize = m_reader.SampleCount * Format.BlockAlign;
     m_bitrate = (int)(Format.SamplesPerSecond * (file.Length-m_data_offset) * 8 / m_reader.SampleCount);
     int frame_buffer_length = m_reader.SamplesPerFrame * m_reader.Format.Channels;
     m_frame_buffer = new ThreadLocal<short[]> (() => new short[frame_buffer_length]);
     m_bytes_per_frame = frame_buffer_length * Format.BitsPerSample / 8;
 }