forked from MoonsideGames/MoonWorks
fix voices not respecting the faux mastering voice
parent
1de3c73bb7
commit
7f6b6a7bae
|
@ -105,7 +105,7 @@ namespace MoonWorks.Audio
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fauxMasteringVoice = new SubmixVoice(this, DeviceDetails.OutputFormat.Format.nChannels, DeviceDetails.OutputFormat.Format.nSamplesPerSec, int.MaxValue);
|
fauxMasteringVoice = SubmixVoice.CreateFauxMasteringVoice(this);
|
||||||
|
|
||||||
/* Init 3D Audio */
|
/* Init 3D Audio */
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,8 @@ namespace MoonWorks.Audio
|
||||||
IntPtr.Zero, // default sends to mastering voice!
|
IntPtr.Zero, // default sends to mastering voice!
|
||||||
IntPtr.Zero
|
IntPtr.Zero
|
||||||
);
|
);
|
||||||
|
|
||||||
|
SetOutputVoice(device.MasteringVoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -23,9 +23,34 @@ namespace MoonWorks.Audio
|
||||||
sampleRate,
|
sampleRate,
|
||||||
FAudio.FAUDIO_VOICE_USEFILTER,
|
FAudio.FAUDIO_VOICE_USEFILTER,
|
||||||
processingStage,
|
processingStage,
|
||||||
|
IntPtr.Zero,
|
||||||
|
IntPtr.Zero
|
||||||
|
);
|
||||||
|
|
||||||
|
SetOutputVoice(device.MasteringVoice);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SubmixVoice(
|
||||||
|
AudioDevice device
|
||||||
|
) : base(device, device.DeviceDetails.OutputFormat.Format.nChannels, device.DeviceDetails.OutputFormat.Format.nChannels)
|
||||||
|
{
|
||||||
|
FAudio.FAudio_CreateSubmixVoice(
|
||||||
|
device.Handle,
|
||||||
|
out handle,
|
||||||
|
device.DeviceDetails.OutputFormat.Format.nChannels,
|
||||||
|
device.DeviceDetails.OutputFormat.Format.nSamplesPerSec,
|
||||||
|
FAudio.FAUDIO_VOICE_USEFILTER,
|
||||||
|
int.MaxValue,
|
||||||
IntPtr.Zero, // default sends to mastering voice
|
IntPtr.Zero, // default sends to mastering voice
|
||||||
IntPtr.Zero
|
IntPtr.Zero
|
||||||
);
|
);
|
||||||
|
|
||||||
|
OutputVoice = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static SubmixVoice CreateFauxMasteringVoice(AudioDevice device)
|
||||||
|
{
|
||||||
|
return new SubmixVoice(device);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,7 +261,6 @@ namespace MoonWorks.Audio
|
||||||
{
|
{
|
||||||
SourceChannelCount = sourceChannelCount;
|
SourceChannelCount = sourceChannelCount;
|
||||||
DestinationChannelCount = destinationChannelCount;
|
DestinationChannelCount = destinationChannelCount;
|
||||||
OutputVoice = device.MasteringVoice;
|
|
||||||
nuint memsize = 4 * sourceChannelCount * destinationChannelCount;
|
nuint memsize = 4 * sourceChannelCount * destinationChannelCount;
|
||||||
pMatrixCoefficients = (byte*) NativeMemory.AllocZeroed(memsize);
|
pMatrixCoefficients = (byte*) NativeMemory.AllocZeroed(memsize);
|
||||||
SetPanMatrixCoefficients();
|
SetPanMatrixCoefficients();
|
||||||
|
|
Loading…
Reference in New Issue