130 uint[] array =
new uint[3];
131 List<uint> list =
new();
132 int millisecondsTimeout = Math.Clamp((
int)(0.5f *
m_bufferDuration / array.Length * 1000f), 1, 100);
134 for (
int i = 0; i < array.Length; i++) {
135 uint num =
Mixer.
AL.GenBuffer();
144 Mixer.
AL.GetSourceProperty(source, GetSourceInteger.BuffersProcessed, out
int value);
146 for (
int j = 0; j < value; j++) {
148 Mixer.
AL.SourceUnqueueBuffers(source, 1, &item);
158 uint num3 = list[^1];
159 GCHandle gCHandle = GCHandle.Alloc(array2, GCHandleType.Pinned);
162 ChannelsCount == 1 ? BufferFormat.Mono16 : BufferFormat.Stereo16,
163 gCHandle.AddrOfPinnedObject().ToPointer(),
168 Mixer.
AL.SourceQueueBuffers(source, 1, &num3);
170 list.RemoveAt(list.Count - 1);
171 Mixer.
AL.GetSourceProperty(source, GetSourceInteger.SourceState, out
int sourceState);
173 if (sourceState != (
int)SourceState.Playing) {
181 Mixer.
AL.GetSourceProperty(source, GetSourceInteger.SourceState, out
int sourceState);
182 if (sourceState == (
int)SourceState.Stopped) {
191 Mixer.
AL.SetSourceProperty(source, SourceInteger.Buffer, 0);
193 for (
int k = 0; k < array.Length; k++) {
195 Mixer.
AL.DeleteBuffer(array[k]);