コード例 #1
0
        /// <summary>
        /// Create a new <see cref="AudioDeviceSession"/>.
        /// </summary>
        /// <param name="deviceSession">The device driver session associated</param>
        /// <param name="bufferEvent">The release buffer event</param>
        /// <param name="bufferRegisteredLimit">The max number of buffers that can be registered to the device driver at a time</param>
        public AudioDeviceSession(IHardwareDeviceSession deviceSession, IWritableEvent bufferEvent, uint bufferRegisteredLimit = 4)
        {
            _bufferEvent           = bufferEvent;
            _hardwareDeviceSession = deviceSession;
            _bufferRegisteredLimit = bufferRegisteredLimit;

            _buffers             = new AudioBuffer[Constants.AudioDeviceBufferCountMax];
            _serverBufferIndex   = 0;
            _hardwareBufferIndex = 0;
            _releasedBufferIndex = 0;

            _bufferAppendedCount   = 0;
            _bufferRegisteredCount = 0;
            _bufferReleasedCount   = 0;
            _volume = deviceSession.GetVolume();
            _state  = AudioDeviceState.Stopped;
        }
コード例 #2
0
 public float GetVolume()
 {
     return(_session.GetVolume());
 }
コード例 #3
0
 /// <summary>
 /// Get the volume of the session.
 /// </summary>
 /// <returns>The volume of the session</returns>
 public float GetVolume()
 {
     return(_hardwareDeviceSession.GetVolume());
 }