コード例 #1
0
        public void GetFloatData(int start, float[] buffer, int offset, int count)
        {
            int i = 0;

            for (; i < count && i + start < 0; i++)
            {
                buffer[offset + i] = 0.0F;
            }
            if (m_Samples.Count - start - i > 0)
            {
                Sample[] samples = new Sample[Math.Min(count - i, m_Samples.Count - start - i)];
                m_Samples.Read(start + i, samples);
                for (int j = 0; j < samples.Length; i++, j++)
                {
                    buffer[offset + i] = (float)(samples[j].Left + samples[j].Right);
                }
            }
            //for (; i < count && i+start<m_Samples.Count; i++)
            //{
            //    buffer[offset + i] = (float)(m_Samples[start + i].Left + m_Samples[start+i].Right);
            //}
            for (; i < count; i++)
            {
                buffer[offset + i] = 0.0F;
            }
        }