private void CheckStreaming() { // is it the first round ? if (streamingBuffers == null) { streamingBuffers = new AudioBuffer[numberOfStreamingBuffers]; streamingBuffersMap = new Dictionary <int, AudioBuffer>(); streamingBuffersIds = new int[numberOfStreamingBuffers]; freeBuffers = new Queue <int>(); for (int i = 0; i < streamingBuffers.Length; i++) { streamingBuffers[i] = new AudioBuffer(); int streamingBufferId = streamingBuffers[i].Id; streamingBuffersMap[streamingBufferId] = streamingBuffers[i]; freeBuffers.Enqueue(streamingBufferId); } streamingBuffersIds = streamingBuffersMap.Keys.ToArray(); this.Stop(); } }