Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }