public PhononSourceVoiceStream(SourceVoice voice) { this.voice = voice; GlobalContext globalContext = default(GlobalContext); RenderingSettings renderingSettings = default(RenderingSettings); renderingSettings.samplingRate = 44100; renderingSettings.frameSize = FrameSize; renderingSettings.convolutionOption = ConvolutionOption.Phonon; HRTFParams hrtfParams = default(HRTFParams); hrtfParams.type = HRTFDatabaseType.Default; IntPtr phononRenderer = IntPtr.Zero; PhononCore.iplCreateBinauralRenderer(globalContext, renderingSettings, hrtfParams, ref phononRenderer); AudioFormat inputFormat = default(AudioFormat); inputFormat.channelLayoutType = ChannelLayoutType.Speakers; inputFormat.channelLayout = ChannelLayout.Mono; inputFormat.channelOrder = ChannelOrder.Interleaved; AudioFormat outputFormat = default(AudioFormat); outputFormat.channelLayoutType = ChannelLayoutType.Speakers; outputFormat.channelLayout = ChannelLayout.Stereo; outputFormat.channelOrder = ChannelOrder.Interleaved; phononInputArray = new float[FrameSize]; phononInputArrayHandle = GCHandle.Alloc(phononInputArray, GCHandleType.Pinned); phononInputBuffer = default(Phonon.AudioBuffer); phononInputBuffer.audioFormat = inputFormat; phononInputBuffer.numSamples = FrameSize; phononInputBuffer.interleavedBuffer = phononInputArrayHandle.AddrOfPinnedObject(); phononOutputArray = new float[FrameSize * 2]; phononOutputArrayHandle = GCHandle.Alloc(phononOutputArray, GCHandleType.Pinned); phononOutputBuffer = default(Phonon.AudioBuffer); phononOutputBuffer.audioFormat = outputFormat; phononOutputBuffer.numSamples = FrameSize; phononOutputBuffer.interleavedBuffer = phononOutputArrayHandle.AddrOfPinnedObject(); phononEffect = IntPtr.Zero; PhononCore.iplCreateBinauralEffect(phononRenderer, inputFormat, outputFormat, ref phononEffect); }
public static extern void iplGetMixedEnvironmentalAudio(IntPtr renderer, Vector3 listenerPosition, Vector3 listenerAhead, Vector3 listenerUp, AudioBuffer mixedWetAudio);
public static extern void iplGetWetAudioForConvolutionEffect(IntPtr effect, Vector3 listenerPosition, Vector3 listenerAhead, Vector3 listenerUp, AudioBuffer wetAudio);
public static extern void iplSetDryAudioForConvolutionEffect(IntPtr effect, Vector3 sourcePosition, AudioBuffer dryAudio);
public static extern void iplApplyAmbisonicsBinauralEffect(IntPtr effect, AudioBuffer inputAudio, AudioBuffer outputAudio);
public static extern void iplApplyVirtualSurroundEffect(IntPtr effect, AudioBuffer inputAudio, AudioBuffer outputAudio);
public static extern void iplApplyBinauralEffect(IntPtr effect, AudioBuffer inputAudio, Vector3 direction, HRTFInterpolation interpolation, AudioBuffer outputAudio);
public static extern void iplApplyPanningEffect(IntPtr effect, AudioBuffer inputAudio, Vector3 direction, AudioBuffer outputAudio);
public static extern void iplRotateAmbisonicsAudioBuffer(IntPtr rotator, AudioBuffer inputAudio, AudioBuffer outputAudio);
public static extern void iplConvertAudioBufferFormat(AudioBuffer inputAudio, AudioBuffer outputAudio);
public static extern void iplDeinterleaveAudioBuffer(AudioBuffer inputAudio, AudioBuffer outputAudio);
public static extern void iplMixAudioBuffers(int numBuffers, AudioBuffer[] inputAudio, AudioBuffer outputAudio);
public static extern void iplApplyDirectSoundEffect(IntPtr effect, AudioBuffer inputAudio, DirectSoundPath directSoundPath, DirectSoundEffectOptions directSoundEffectOptions, AudioBuffer outputAudio);