Пример #1
0
        /// <summary>
        /// Fills the buffer with new data.
        /// </summary>
        /// <param name="index">The starting index from where to fill the buffer.</param>
        /// <param name="data">The new content of the buffers.</param>
        /// <param name="format">The format the buffers are in.</param>
        /// <param name="sampleRate">The samplerate of the buffers.</param>
        public void FillBuffer(int index, short[] data, ALFormat format, int sampleRate)
        {
            if (index < 0 || index >= this.Handles.Length)
            {
                throw new ArgumentOutOfRangeException("index");
            }

            ALHelper.Call(() => AL.BufferData(this.Handles[index], format, data, data.Length * sizeof(short), sampleRate));
        }
Пример #2
0
        /// <summary>
        /// Disposes the buffer.
        /// </summary>
        public void Dispose()
        {
            if (this.Disposed)
            {
                return;
            }

            ALHelper.Call(AL.DeleteBuffers, this.Handles);

            this.Disposed = true;
        }