/// <summary> /// Creates and configures a mastering voice. /// </summary> /// <param name="device">an instance of <see cref = "SharpDX.XAudio2.XAudio2" /></param> /// <param name="inputChannels">[in] Number of channels the mastering voice expects in its input audio. InputChannels must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. InputChannels can be set to XAUDIO2_DEFAULT_CHANNELS, with the default being determined by the current platform. Windows Attempts to detect the system speaker configuration setup. Xbox 360 Defaults to 5.1 surround. </param> /// <param name="inputSampleRate">[in] Sample rate of the input audio data of the mastering voice. This rate must be a multiple of XAUDIO2_QUANTUM_DENOMINATOR. InputSampleRate must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. InputSampleRate can be set to XAUDIO2_DEFAULT_SAMPLERATE, with the default being determined by the current platform. Windows Windows XP defaults to 44100. Windows Vista and Windows 7 default to the setting specified in the Sound Control Panel. The default for this setting is 44100 (or 48000 if required by the driver). Xbox 360 Defaults to 48000. </param> /// <param name="deviceId">[in] Index of the output device that will be sent input by the mastering voice. Specifying the default value of 0 causes XAudio2 to select the global default audio device. </param> /// <unmanaged>HRESULT IXAudio2::CreateMasteringVoice([Out] IXAudio2MasteringVoice** ppMasteringVoice,[None] UINT32 InputChannels,[None] UINT32 InputSampleRate,[None] UINT32 Flags,[None] UINT32 DeviceIndex,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain)</unmanaged> public MasteringVoice(XAudio2 device, int inputChannels = 2, int inputSampleRate = 44100) : base(IntPtr.Zero) { if (XAudio2.Version == XAudio2Version.Version27) { device.CreateMasteringVoice27(this, inputChannels, inputSampleRate, 0, 0, null); } else { device.CreateMasteringVoice(this, inputChannels, inputSampleRate, 0, null, null, AudioStreamCategory.GameEffects); } }
/// <summary> /// Creates and configures a mastering voice. /// </summary> /// <param name="device">an instance of <see cref = "SharpDX.XAudio2.XAudio2" /></param> /// <param name="inputChannels">[in] Number of channels the mastering voice expects in its input audio. InputChannels must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. InputChannels can be set to XAUDIO2_DEFAULT_CHANNELS, with the default being determined by the current platform. Windows Attempts to detect the system speaker configuration setup. Xbox 360 Defaults to 5.1 surround. </param> /// <param name="inputSampleRate">[in] Sample rate of the input audio data of the mastering voice. This rate must be a multiple of XAUDIO2_QUANTUM_DENOMINATOR. InputSampleRate must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. InputSampleRate can be set to XAUDIO2_DEFAULT_SAMPLERATE, with the default being determined by the current platform. Windows Windows XP defaults to 44100. Windows Vista and Windows 7 default to the setting specified in the Sound Control Panel. The default for this setting is 44100 (or 48000 if required by the driver). Xbox 360 Defaults to 48000. </param> /// <param name="deviceId">[in] Index of the output device that will be sent input by the mastering voice. Specifying the default value of 0 causes XAudio2 to select the global default audio device. </param> /// <unmanaged>HRESULT IXAudio2::CreateMasteringVoice([Out] IXAudio2MasteringVoice** ppMasteringVoice,[None] UINT32 InputChannels,[None] UINT32 InputSampleRate,[None] UINT32 Flags,[None] UINT32 DeviceIndex,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain)</unmanaged> public MasteringVoice(XAudio2 device, int inputChannels = 2, int inputSampleRate = 44100) : base(device) { if (device.Version == XAudio2Version.Version27) { device.CreateMasteringVoice27(this, inputChannels, inputSampleRate, 0, 0, null); } else { device.CreateMasteringVoice(this, inputChannels, inputSampleRate, 0, null, null, AudioStreamCategory.GameEffects); } }
/// <summary> /// Creates and configures a mastering voice (Valid only for XAudio2.7) /// </summary> /// <param name="device">an instance of <see cref="SharpDX.XAudio2.XAudio2" /></param> /// <param name="inputChannels">[in] Number of channels the mastering voice expects in its input audio. InputChannels must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. InputChannels can be set to XAUDIO2_DEFAULT_CHANNELS, with the default being determined by the current platform. Windows Attempts to detect the system speaker configuration setup. Xbox 360 Defaults to 5.1 surround.</param> /// <param name="inputSampleRate">[in] Sample rate of the input audio data of the mastering voice. This rate must be a multiple of XAUDIO2_QUANTUM_DENOMINATOR. InputSampleRate must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. InputSampleRate can be set to XAUDIO2_DEFAULT_SAMPLERATE, with the default being determined by the current platform. Windows Windows XP defaults to 44100. Windows Vista and Windows 7 default to the setting specified in the Sound Control Panel. The default for this setting is 44100 (or 48000 if required by the driver). Xbox 360 Defaults to 48000.</param> /// <param name="deviceIndex">Index of the device.</param> /// <unmanaged>HRESULT IXAudio2::CreateMasteringVoice([Out] IXAudio2MasteringVoice** ppMasteringVoice,[None] UINT32 InputChannels,[None] UINT32 InputSampleRate,[None] UINT32 Flags,[None] UINT32 DeviceIndex,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain)</unmanaged> public MasteringVoice(XAudio2 device, int inputChannels, int inputSampleRate, int deviceIndex) : base(IntPtr.Zero) { device.CreateMasteringVoice27(this, inputChannels, inputSampleRate, 0, deviceIndex, null); }
/// <summary> /// Creates and configures a mastering voice (Valid only for XAudio2.7) /// </summary> /// <param name="device">an instance of <see cref="SharpDX.XAudio2.XAudio2" /></param> /// <param name="inputChannels">[in] Number of channels the mastering voice expects in its input audio. InputChannels must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. InputChannels can be set to XAUDIO2_DEFAULT_CHANNELS, with the default being determined by the current platform. Windows Attempts to detect the system speaker configuration setup. Xbox 360 Defaults to 5.1 surround.</param> /// <param name="inputSampleRate">[in] Sample rate of the input audio data of the mastering voice. This rate must be a multiple of XAUDIO2_QUANTUM_DENOMINATOR. InputSampleRate must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. InputSampleRate can be set to XAUDIO2_DEFAULT_SAMPLERATE, with the default being determined by the current platform. Windows Windows XP defaults to 44100. Windows Vista and Windows 7 default to the setting specified in the Sound Control Panel. The default for this setting is 44100 (or 48000 if required by the driver). Xbox 360 Defaults to 48000.</param> /// <param name="deviceIndex">Index of the device.</param> /// <unmanaged>HRESULT IXAudio2::CreateMasteringVoice([Out] IXAudio2MasteringVoice** ppMasteringVoice,[None] UINT32 InputChannels,[None] UINT32 InputSampleRate,[None] UINT32 Flags,[None] UINT32 DeviceIndex,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain)</unmanaged> public MasteringVoice(XAudio2 device, int inputChannels, int inputSampleRate, int deviceIndex) : base(device) { device.CheckVersion27(); device.CreateMasteringVoice27(this, inputChannels, inputSampleRate, 0, deviceIndex, null); }
/// <summary> /// Creates and configures a mastering voice (Valid only for XAudio2.7) /// </summary> /// <param name="device">an instance of <see cref="SharpDX.XAudio2.XAudio2" /></param> /// <param name="inputChannels">[in] Number of channels the mastering voice expects in its input audio. InputChannels must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. InputChannels can be set to XAUDIO2_DEFAULT_CHANNELS, with the default being determined by the current platform. Windows Attempts to detect the system speaker configuration setup. Xbox 360 Defaults to 5.1 surround.</param> /// <param name="inputSampleRate">[in] Sample rate of the input audio data of the mastering voice. This rate must be a multiple of XAUDIO2_QUANTUM_DENOMINATOR. InputSampleRate must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. InputSampleRate can be set to XAUDIO2_DEFAULT_SAMPLERATE, with the default being determined by the current platform. Windows Windows XP defaults to 44100. Windows Vista and Windows 7 default to the setting specified in the Sound Control Panel. The default for this setting is 44100 (or 48000 if required by the driver). Xbox 360 Defaults to 48000.</param> /// <param name="deviceIndex">Index of the device.</param> /// <unmanaged>HRESULT IXAudio2::CreateMasteringVoice([Out] IXAudio2MasteringVoice** ppMasteringVoice,[None] UINT32 InputChannels,[None] UINT32 InputSampleRate,[None] UINT32 Flags,[None] UINT32 DeviceIndex,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain)</unmanaged> public MasteringVoice(XAudio2 device, int inputChannels, int inputSampleRate, int deviceIndex) : base(device) { device.CreateMasteringVoice27(this, inputChannels, inputSampleRate, 0, deviceIndex, null); }