Пример #1
0
 public int LoadToBuffer(AudioBuffer buffer, int amount)
 {
     if (loader.BitsPerSample == 32)
     {
         return(buffer.Load(loader.ReadSamples32(amount), loader.Frequency, loader.Channels));
     }
     else if (loader.BitsPerSample == 16)
     {
         return(buffer.Load(loader.ReadSamples16(amount), loader.Frequency, loader.Channels));
     }
     else if (loader.BitsPerSample == 8)
     {
         return(buffer.Load(loader.ReadSamples8(amount), loader.Frequency, loader.Channels));
     }
     return(-1);
 }
Пример #2
0
        public int Read(AudioBuffer audioBuffer)
        {
            int samples = AvailableSamples;

            Alc.CaptureSamples(deviceId, bufferPtr, samples);
            audioBuffer.Load(buffer, samples, frequency, channels);
            return(samples);
        }