Esempio n. 1
0
        protected override void OnBufferNeeded(object sender, EventArgs e)
        {
            if (m_Playing)
            {
                if (SoundInstance == null)
                {
                    Stop();

                    return;
                }

                while (SoundInstance.PendingBufferCount < 3)
                {
                    byte[] buffer = GetBuffer();

                    if (SoundInstance.IsDisposed || buffer == null)
                    {
                        break;
                    }

                    SoundInstance.SubmitBuffer(buffer);
                }
            }
        }