/// <summary> /// Atomically applies a set of operations that are tagged with a given identifier. /// </summary> /// <param name="operationSet"> /// Identifier of the set of operations to be applied. To commit all pending operations, pass /// <see cref="CommitAll" />. /// </param> /// <returns>HRESULT</returns> public override unsafe int CommitChangesNative(int operationSet) { return(InteropCalls.CallI(UnsafeBasePtr, operationSet, ((void **)(*(void **)UnsafeBasePtr))[13])); }
/// <summary> /// Changes <b>global</b> debug logging options for XAudio2. /// </summary> /// <param name="debugConfiguration"><see cref="DebugConfiguration" /> structure that contains the new debug configuration.</param> /// <param name="reserved">Reserved parameter. Must me NULL.</param> /// <returns>HRESULT</returns> public override unsafe void SetDebugConfigurationNative(DebugConfiguration debugConfiguration, IntPtr reserved) { InteropCalls.CallI4(UnsafeBasePtr, &debugConfiguration, reserved.ToPointer(), ((void **)(*(void **)UnsafeBasePtr))[15]); }
/// <summary> /// Starts the audio processing thread. /// </summary> /// <returns>HRESULT</returns> public override unsafe int StartEngineNative() { return(InteropCalls.CallI(UnsafeBasePtr, ((void **)(*(void **)UnsafeBasePtr))[11])); }
/// <summary> /// Stops the audio processing thread. /// </summary> public override unsafe void StopEngine() { InteropCalls.CallI7(UnsafeBasePtr, ((void **)(*(void **)UnsafeBasePtr))[12]); }
/// <summary> /// Sets XAudio2 parameters and prepares XAudio2 for use. /// </summary> /// <param name="flags">Flags that specify the behavior of the XAudio2 object. This value must be 0.</param> /// <param name="processor"> /// Specifies which CPU to use. Use <see cref="XAudio2Processor.XAudio27DefaultProcessor" /> as default value. /// </param> /// <returns>HRESULT</returns> public unsafe int InitializeNative(int flags, XAudio2Processor processor) { return(InteropCalls.CallI(UnsafeBasePtr, flags, processor, ((void **)(*(void **)UnsafeBasePtr))[5])); }
/// <summary> /// Removes an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list. /// </summary> /// <param name="callback"> /// <see cref="IXAudio2EngineCallback" /> object to remove from the <see cref="XAudio2" /> engine /// callback list. If the given interface is present more than once in the list, only the first instance in the list /// will be removed. /// </param> public override unsafe void UnregisterForCallbacks(IXAudio2EngineCallback callback) { InteropCalls.CallI6(UnsafeBasePtr, callback, ((void **)(*(void **)UnsafeBasePtr))[7]); }
/// <summary> /// Starts consumption and processing of audio by the voice. Delivers the result to any connected submix or mastering /// voices, or to the output device. /// </summary> /// <param name="flags">Flags that control how the voice is started. Must be 0.</param> /// <param name="operationSet"> /// Identifies this call as part of a deferred batch. For more details see /// http://msdn.microsoft.com/en-us/library/windows/desktop/ee415807(v=vs.85).aspx. /// </param> /// <returns>HRESULT</returns> public unsafe int StartNative(int flags, int operationSet) { return(InteropCalls.CallI(UnsafeBasePtr, flags, operationSet, ((void **)(*(void **)UnsafeBasePtr))[19])); }
/// <summary> /// Stops consumption of audio by the current voice. /// </summary> /// <param name="flags"> /// Flags that control how the voice is stopped. Can be <see cref="SourceVoiceStopFlags.None" /> or /// <see cref="SourceVoiceStopFlags.PlayTails" />. /// </param> /// <param name="operationSet"> /// Identifies this call as part of a deferred batch. For more details see /// http://msdn.microsoft.com/en-us/library/windows/desktop/ee415807(v=vs.85).aspx. /// </param> /// <returns>HRESULT</returns> public unsafe int StopNative(SourceVoiceStopFlags flags, int operationSet) { return(InteropCalls.CallI(UnsafeBasePtr, flags, operationSet, ((void **)(*(void **)UnsafeBasePtr))[20])); }
/// <summary> /// Returns the frequency adjustment ratio of the voi /// </summary> /// <returns>Current frequency adjustment ratio if successful.</returns> public unsafe float GetFrequencyRatio() { float value = default(float); return(InteropCalls.CallI1(UnsafeBasePtr, &value, ((void **)(*(void **)UnsafeBasePtr))[27])); }
/// <summary> /// Reconfigures the voice to consume source data at a different sample rate than the rate specified when the voice was /// created. /// </summary> /// <param name="newSourceSampleRate"> /// The new sample rate the voice should process submitted data at. Valid sample rates /// are 1kHz to 200kHz. /// </param> /// <returns>HRESULT</returns> public unsafe int SetSourceSampleRateNative(int newSourceSampleRate) { return(InteropCalls.CallI(UnsafeBasePtr, newSourceSampleRate, ((void **)(*(void **)UnsafeBasePtr))[28])); }
/// <summary> /// Sets the frequency adjustment ratio of the voice. /// </summary> /// <param name="ratio"> /// Frequency adjustment ratio. This value must be between <see cref="XAudio2.MinFrequencyRatio" /> and /// the MaxFrequencyRatio parameter specified when the voice was created /// <see /// cref="XAudio2.CreateSourceVoice(CSCore.WaveFormat,CSCore.XAudio2.VoiceFlags,float,CSCore.XAudio2.IXAudio2VoiceCallback,System.Nullable{CSCore.XAudio2.VoiceSends},System.Nullable{CSCore.XAudio2.EffectChain})" /> /// . /// </param> /// <param name="operationSet"> /// Identifies this call as part of a deferred batch. For more details see /// http://msdn.microsoft.com/en-us/library/windows/desktop/ee415807(v=vs.85).aspx. /// </param> /// <returns>HRESULT</returns> public unsafe int SetFrequencyRatioNative(float ratio, int operationSet) { return(InteropCalls.CallI(UnsafeBasePtr, ratio, operationSet, ((void **)(*(void **)UnsafeBasePtr))[26])); }
/// <summary> /// Stops looping the voice when it reaches the end of the current loop region. /// </summary> /// <param name="operationSet"> /// Identifies this call as part of a deferred batch. For more details see /// http://msdn.microsoft.com/en-us/library/windows/desktop/ee415807(v=vs.85).aspx. /// </param> /// <returns>HRESULT</returns> public unsafe int ExitLoopNative(int operationSet) { return(InteropCalls.CallI(UnsafeBasePtr, operationSet, ((void **)(*(void **)UnsafeBasePtr))[24])); }
/// <summary> /// Notifies an XAudio2 voice that no more buffers are coming after the last one that is currently in its queue. /// </summary> /// <returns>HRESULT</returns> public unsafe int DiscontinuityNative() { return(InteropCalls.CallI(UnsafeBasePtr, ((void **)(*(void **)UnsafeBasePtr))[23])); }
/// <summary> /// Removes all pending audio buffers from the voice queue. If the voice is started, the buffer that is currently /// playing is not removed from the queue. /// </summary> /// <returns>HRESULT</returns> /// <remarks> /// See /// http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.ixaudio2sourcevoice.ixaudio2sourcevoice.flushsourcebuffers(v=vs.85).aspx. /// </remarks> public unsafe int FlushSourceBuffersNative() { return(InteropCalls.CallI(UnsafeBasePtr, ((void **)(*(void **)UnsafeBasePtr))[22])); }
/// <summary> /// Adds a new audio buffer to the voice queue. /// </summary> /// <param name="buffer">Pointer to an <see cref="XAudio2Buffer" /> structure to queue.</param> /// <param name="bufferWma">Pointer to an additional XAudio2BufferWma structure used when submitting WMA data.</param> /// <returns>HRESULT</returns> /// <remarks> /// See /// http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.ixaudio2sourcevoice.ixaudio2sourcevoice.submitsourcebuffer(v=vs.85).aspx. /// </remarks> public unsafe int SubmitSourceBufferNative(IntPtr buffer, IntPtr bufferWma) { return(InteropCalls.CallI(UnsafeBasePtr, (void *)buffer, (void *)bufferWma, ((void **)(*(void **)UnsafeBasePtr))[21])); }