Beispiel #1
0
 public void Read <T>(T[] data)
 {
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     Read(data, 0, data.Length * Marshal.SizeOf(typeof(T)) / format.SampleByteSize());
 }
Beispiel #2
0
        public void Data(AudioFormat format, IntPtr buffer, int bytes, Frequency frequency)
        {
            int bytesPerSample = format.SampleByteSize();

            using (Context.Bind())
                AL.BufferData(Id, (ALFormat)format, buffer, bytes / bytesPerSample * bytesPerSample, (int)Math.Round(frequency.InHertz));
            this.format = format;
        }