예제 #1
0
        private void BufferNeeded(object sender, EventArgs e)
        {
            lock (this)
            {
                if (enumerator == null)
                {
                    MediaState = MediaState.Stopped;
                    return;
                }
                else if (bufferCount == -1)
                {
                    if (!enumerator.MoveNext())
                    {
                        return;
                    }

                    bufferCount = enumerator.Current.Length;
                }

                for (int i = 0; i < 2; i++)
                {
                    byte[] buffer = enumerator.Current.Bytes;
                    effect.SubmitBuffer(buffer, 0, bufferCount);

                    if (enumerator.MoveNext())
                    {
                        bufferCount = enumerator.Current.Length;
                    }
                    else
                    {
                        enumerator.Dispose();
                        decoder.Reset();
                        if (Repeat)
                        {
                            enumerator = decoder.GetEnumerator();
                        }
                        else
                        {
                            enumerator = null;
                        }
                        bufferCount = -1;
                        break;
                    }
                }
            }
        }
예제 #2
0
    public CSVOggPlayer(System.IO.Stream s, bool seek = false)
    {
        decoder.Initialize(s, seek);
        it = decoder.GetEnumerator();


        Debug.Log(now);
        isPlaying = true;
        Debug.Log("OggPlayer");
    }