开发者

Gain sole control of Audio Output, DirectSound

I am creating a basic signal generator and decided to use my audio card as the analogue output. I chose to use DirectSound because... it seemed like a good option.

I have it up and running quite nicely, but I now realize that my code using secondary buffers and as such any other sounds on the computer get mixed in with my generated signal. This is somethi开发者_Python百科ng of an issue, as when I'm running a motor I don't want it to get sent an MSN poke noise as a command.

In order to gain total control I've attempted to take over the system by setting my cooperative level to DSSCL_WRITEPRIMARY. All in all this strategy is really giving me a headache as I am running into error after error trying to get this set up. The documentation on using the primary buffer isn't great and I can't find any really good examples.

So my question is:

  1. Does anyone have a good, working example of taking over and writing to the primarybuffer.

  2. Is there a simpler way of outputing a waveform to the audio card, and ensuring that my application has full and sole control?

Thank you


only thing I've seen related is:

http://blogs.msdn.com/b/matthew_van_eerde/archive/2009/04/03/sample-wasapi-exclusive-mode-event-driven-playback-app-including-the-hd-audio-alignment-dance.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜