Closed as00374 closed 10 years ago
This is more likely an XAudio2 usage issue, I am not sure if you will get much help here. Try to enable native debugging. If you are on Windows 7 - try to enable XAudio debugging.
Btw, why you put STAThread
to called methods instead of Main
? This looks quite strange. Why do you need the base class ThreadStaticAttribute
there?
@as00374, have you made any progress on this issue?
Thanks for looking into this @ArtiomCiumac. I have changed from using SharpDX to NAudio as native ASIO support was the easiest solution to this issue. FTW, I was using STAThread because audio process is real-time critical, therefore I don't want multiple threads accessing it. I wasn't running the code on the main because my main thread is Kinect skeletal tracking using real-time object tracking and didn't want to be doing image processing and sensitive audio processing on the same thread.
Thanks again
I still don't understand if there is a problem with SharpDX itself or its usage. Try to start with a sample and modify it to suit your needs. Also, I am not sure if you need the STA attribute - as this is more related to UI like WinForms or WPF, but DirectX works fine in multithreaded environments.
If you have time - have a look at the SharpDX.Toolkit.Audio - it provides a simplified wrapper over the XAudio2 API.
I will close this issue for now - feel free to reopen it if you you believe your usage is correct and there is an issue with SharpDX.
I deleted my post after I saw there was a different way of setting the effects, which I've now got working. I'm not sure if the other way should work, I was looking at C++ XAudio2 examples and trying to do the same.
I'll stick my test code back up if needed.
I am having some issues with XAudio2. I am attempting to implement single-voice-multiple-output using SourceVoice.SetOutputVoices by creating an array of VoiceSendDescriptors, but I get access violations for the filter parameters for all voices of any type, making this process fail. Can anyone tell me why this is and how I can fix it (Code below). Any help appreciates. Thanks: