forked from MoonsideGames/MoonWorks
move default reverb params to a static var
parent
be77e8bad1
commit
1bff459be6
|
@ -8,6 +8,33 @@ namespace MoonWorks.Audio
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public unsafe class ReverbEffect : SubmixVoice
|
public unsafe class ReverbEffect : SubmixVoice
|
||||||
{
|
{
|
||||||
|
// Defaults based on FAUDIOFX_I3DL2_PRESET_GENERIC
|
||||||
|
public static FAudio.FAudioFXReverbParameters DefaultParams = new FAudio.FAudioFXReverbParameters
|
||||||
|
{
|
||||||
|
WetDryMix = 100.0f,
|
||||||
|
ReflectionsDelay = 7,
|
||||||
|
ReverbDelay = 11,
|
||||||
|
RearDelay = FAudio.FAUDIOFX_REVERB_DEFAULT_REAR_DELAY,
|
||||||
|
PositionLeft = FAudio.FAUDIOFX_REVERB_DEFAULT_POSITION,
|
||||||
|
PositionRight = FAudio.FAUDIOFX_REVERB_DEFAULT_POSITION,
|
||||||
|
PositionMatrixLeft = FAudio.FAUDIOFX_REVERB_DEFAULT_POSITION_MATRIX,
|
||||||
|
PositionMatrixRight = FAudio.FAUDIOFX_REVERB_DEFAULT_POSITION_MATRIX,
|
||||||
|
EarlyDiffusion = 15,
|
||||||
|
LateDiffusion = 15,
|
||||||
|
LowEQGain = 8,
|
||||||
|
LowEQCutoff = 4,
|
||||||
|
HighEQGain = 8,
|
||||||
|
HighEQCutoff = 6,
|
||||||
|
RoomFilterFreq = 5000f,
|
||||||
|
RoomFilterMain = -10f,
|
||||||
|
RoomFilterHF = -1f,
|
||||||
|
ReflectionsGain = -26.0200005f,
|
||||||
|
ReverbGain = 10.0f,
|
||||||
|
DecayTime = 1.49000001f,
|
||||||
|
Density = 100.0f,
|
||||||
|
RoomSize = FAudio.FAUDIOFX_REVERB_DEFAULT_ROOM_SIZE
|
||||||
|
};
|
||||||
|
|
||||||
public ReverbEffect(AudioDevice audioDevice, uint processingStage) : base(audioDevice, 1, audioDevice.DeviceDetails.OutputFormat.Format.nSamplesPerSec, processingStage)
|
public ReverbEffect(AudioDevice audioDevice, uint processingStage) : base(audioDevice, 1, audioDevice.DeviceDetails.OutputFormat.Format.nSamplesPerSec, processingStage)
|
||||||
{
|
{
|
||||||
/* Init reverb */
|
/* Init reverb */
|
||||||
|
@ -15,11 +42,12 @@ namespace MoonWorks.Audio
|
||||||
FAudio.FAudioCreateReverb(out reverb, 0);
|
FAudio.FAudioCreateReverb(out reverb, 0);
|
||||||
|
|
||||||
var chain = new FAudio.FAudioEffectChain();
|
var chain = new FAudio.FAudioEffectChain();
|
||||||
var descriptor = new FAudio.FAudioEffectDescriptor();
|
var descriptor = new FAudio.FAudioEffectDescriptor
|
||||||
|
{
|
||||||
descriptor.InitialState = 1;
|
InitialState = 1,
|
||||||
descriptor.OutputChannels = 1;
|
OutputChannels = 1,
|
||||||
descriptor.pEffect = reverb;
|
pEffect = reverb
|
||||||
|
};
|
||||||
|
|
||||||
chain.EffectCount = 1;
|
chain.EffectCount = 1;
|
||||||
chain.pEffectDescriptors = (nint) (&descriptor);
|
chain.pEffectDescriptors = (nint) (&descriptor);
|
||||||
|
@ -31,34 +59,7 @@ namespace MoonWorks.Audio
|
||||||
|
|
||||||
FAudio.FAPOBase_Release(reverb);
|
FAudio.FAPOBase_Release(reverb);
|
||||||
|
|
||||||
/* Init reverb params */
|
SetParams(DefaultParams);
|
||||||
// Defaults based on FAUDIOFX_I3DL2_PRESET_GENERIC
|
|
||||||
|
|
||||||
FAudio.FAudioFXReverbParameters reverbParams;
|
|
||||||
reverbParams.WetDryMix = 100.0f;
|
|
||||||
reverbParams.ReflectionsDelay = 7;
|
|
||||||
reverbParams.ReverbDelay = 11;
|
|
||||||
reverbParams.RearDelay = FAudio.FAUDIOFX_REVERB_DEFAULT_REAR_DELAY;
|
|
||||||
reverbParams.PositionLeft = FAudio.FAUDIOFX_REVERB_DEFAULT_POSITION;
|
|
||||||
reverbParams.PositionRight = FAudio.FAUDIOFX_REVERB_DEFAULT_POSITION;
|
|
||||||
reverbParams.PositionMatrixLeft = FAudio.FAUDIOFX_REVERB_DEFAULT_POSITION_MATRIX;
|
|
||||||
reverbParams.PositionMatrixRight = FAudio.FAUDIOFX_REVERB_DEFAULT_POSITION_MATRIX;
|
|
||||||
reverbParams.EarlyDiffusion = 15;
|
|
||||||
reverbParams.LateDiffusion = 15;
|
|
||||||
reverbParams.LowEQGain = 8;
|
|
||||||
reverbParams.LowEQCutoff = 4;
|
|
||||||
reverbParams.HighEQGain = 8;
|
|
||||||
reverbParams.HighEQCutoff = 6;
|
|
||||||
reverbParams.RoomFilterFreq = 5000f;
|
|
||||||
reverbParams.RoomFilterMain = -10f;
|
|
||||||
reverbParams.RoomFilterHF = -1f;
|
|
||||||
reverbParams.ReflectionsGain = -26.0200005f;
|
|
||||||
reverbParams.ReverbGain = 10.0f;
|
|
||||||
reverbParams.DecayTime = 1.49000001f;
|
|
||||||
reverbParams.Density = 100.0f;
|
|
||||||
reverbParams.RoomSize = FAudio.FAUDIOFX_REVERB_DEFAULT_ROOM_SIZE;
|
|
||||||
|
|
||||||
SetParams(reverbParams);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetParams(in FAudio.FAudioFXReverbParameters reverbParams)
|
public void SetParams(in FAudio.FAudioFXReverbParameters reverbParams)
|
||||||
|
|
Loading…
Reference in New Issue