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);
    }
示例#2
0
 public static extern void iplGetMixedEnvironmentalAudio(IntPtr renderer, Vector3 listenerPosition, Vector3 listenerAhead, Vector3 listenerUp, AudioBuffer mixedWetAudio);
示例#3
0
 public static extern void iplGetWetAudioForConvolutionEffect(IntPtr effect, Vector3 listenerPosition, Vector3 listenerAhead, Vector3 listenerUp, AudioBuffer wetAudio);
示例#4
0
 public static extern void iplSetDryAudioForConvolutionEffect(IntPtr effect, Vector3 sourcePosition, AudioBuffer dryAudio);
示例#5
0
 public static extern void iplApplyAmbisonicsBinauralEffect(IntPtr effect, AudioBuffer inputAudio, AudioBuffer outputAudio);
示例#6
0
 public static extern void iplApplyVirtualSurroundEffect(IntPtr effect, AudioBuffer inputAudio, AudioBuffer outputAudio);
示例#7
0
 public static extern void iplApplyBinauralEffect(IntPtr effect, AudioBuffer inputAudio, Vector3 direction, HRTFInterpolation interpolation, AudioBuffer outputAudio);
示例#8
0
 public static extern void iplApplyPanningEffect(IntPtr effect, AudioBuffer inputAudio, Vector3 direction, AudioBuffer outputAudio);
示例#9
0
 public static extern void iplRotateAmbisonicsAudioBuffer(IntPtr rotator, AudioBuffer inputAudio, AudioBuffer outputAudio);
示例#10
0
 public static extern void iplConvertAudioBufferFormat(AudioBuffer inputAudio, AudioBuffer outputAudio);
示例#11
0
 public static extern void iplDeinterleaveAudioBuffer(AudioBuffer inputAudio, AudioBuffer outputAudio);
示例#12
0
 public static extern void iplMixAudioBuffers(int numBuffers, AudioBuffer[] inputAudio, AudioBuffer outputAudio);
示例#13
0
 public static extern void iplApplyDirectSoundEffect(IntPtr effect, AudioBuffer inputAudio, DirectSoundPath directSoundPath, DirectSoundEffectOptions directSoundEffectOptions, AudioBuffer outputAudio);