Ejemplo n.º 1
0
        private bool TryStream(int buffer)
        {
            int bytesRead = musicStream.Read(bufferData, BufferSize);

            if (bytesRead == 0)
            {
                return(false);
            }
            openAL.BufferData(buffer, format, bufferData, bytesRead, musicStream.Samplerate);
            openAL.QueueBufferInChannel(buffer, channelHandle);
            return(true);
        }
Ejemplo n.º 2
0
 protected bool Stream(int buffer)
 {
     try
     {
         byte[] bufferData = new byte[4096];
         video.ReadMusicBytes(bufferData, bufferData.Length);
         openAL.BufferData(buffer, format, bufferData, bufferData.Length, video.Samplerate);
         openAL.QueueBufferInChannel(buffer, channelHandle);
     }
     catch
     {
         return(false);
     }
     return(true);
 }