Example #1
0
        public ALSource()
        {
            _sourceHandle = AL.GenSource();
            ALHelper.CheckLastError();

            Initialize();
        }
Example #2
0
        public override void Dispose()
        {
            if (!_disposed)
            {
                AL.DeleteBuffer(BufferHandle);
                ALHelper.CheckLastError();

                _disposed = true;
            }
        }
Example #3
0
        internal ALSound(WaveAudio waveAudio)
        {
            WaveAudio = waveAudio;

            BufferHandle = AL.GenBuffer();
            ALHelper.CheckLastError();

            AL.BufferData(BufferHandle,
                          ALHelper.GetSoundFormat(WaveAudio.WaveInfo.Channels, WaveAudio.WaveInfo.BitDepth),
                          ref WaveAudio.WaveData[0],
                          WaveAudio.WaveData.Length,
                          WaveAudio.WaveInfo.SampleRate);
            ALHelper.CheckLastError();

            Duration = WaveAudio.Duration;
        }