示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SoundSource"/> class.
        /// </summary>
        public SoundSource()
        {
            // Ensure that AudioDevice is initialized
            AudioDevice.Initialize();

            ALChecker.Check(() => _source = AL.GenSource());
            ALChecker.Check(() => AL.Source(_source, ALSourcei.Buffer, 0));
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SoundBuffer"/> class.
        /// </summary>
        public SoundBuffer()
        {
            // Ensure that AudioDevice is initialized
            AudioDevice.Initialize();

            _samples  = new short[0];
            _sounds   = new List <Sound>();
            _duration = TimeSpan.Zero;

            // Create the buffer
            ALChecker.Check(() => _buffer = AL.GenBuffer());
        }