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