public void AppendBuffer(int Track, long Tag, byte[] Buffer) { if (Tracks.TryGetValue(Track, out Track Td)) { int BufferId = Td.AppendBuffer(Tag); AL.BufferData(BufferId, Td.Format, Buffer, Buffer.Length, Td.SampleRate); AL.SourceQueueBuffer(Td.SourceId, BufferId); StartPlaybackIfNeeded(Td); } }
public void AppendBuffer <T>(int Track, long Tag, T[] Buffer) where T : struct { if (Tracks.TryGetValue(Track, out Track Td)) { int BufferId = Td.AppendBuffer(Tag); int Size = Buffer.Length * Marshal.SizeOf <T>(); AL.BufferData <T>(BufferId, Td.Format, Buffer, Size, Td.SampleRate); AL.SourceQueueBuffer(Td.SourceId, BufferId); StartPlaybackIfNeeded(Td); } }