Ejemplo n.º 1
0
        public void Read()
        {
            m_Riff.ReadRiff(m_FileStream);
            m_Fmt.ReadFmt(m_FileStream);
            m_Data.ReadData(m_FileStream, m_Fmt.Channels);
            time = (((long)m_Data.DataSize - 44) / (m_Fmt.SamplesPerSec * (m_Fmt.BitsPerSample / 8))) / m_Fmt.Channels;
            int disposedsamples = 0;

            for (int j = m_Data.Samples.Length - 1; j > 0; j--)
            {
                if (m_Data[j] != 0)
                {
                    break;
                }
                disposedsamples++;
            }
            Int16[] newps = new Int16[m_Data.Samples.Length - disposedsamples];
            for (int i = 0; i < newps.Length; i++)
            {
                newps[i] = m_Data.Samples[i];
            }
            m_Data.ProcessedSamples = (Int16[])newps.Clone();
        }