<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Audio/XACT</title><link>http://forums.xna.com/forums/33.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>After calling X3DAudioCalculate application crashes on close, why?</title><link>http://forums.xna.com/forums/thread/253307.aspx</link><pubDate>Fri, 20 Nov 2009 00:46:02 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:253307</guid><dc:creator>Unholysavagery</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/253307.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=253307</wfw:commentRss><description>&lt;span style="color:#000000;font-family:verdana, arial;"&gt;My program won&amp;#39;t close after I call X3DAudioCalculate, is there something I need to do before closing my program?&lt;/span&gt;&lt;div&gt;&lt;span style="font-family:verdana, arial;color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:verdana, arial;color:#000000;"&gt;I can&amp;#39;t delete pMatrixCoefficients of the DSPSettings structure so I&amp;#39;m guessing there is something I need to do to free the memory X3DAudio is using but I don&amp;#39;t know how and I can&amp;#39;t seem to find any documentation about releasing it...&lt;/span&gt;&lt;/div&gt;</description></item><item><title>C# Audio Synthesis?</title><link>http://forums.xna.com/forums/thread/235785.aspx</link><pubDate>Thu, 08 Oct 2009 06:59:53 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:235785</guid><dc:creator>LetsGoOutside</dc:creator><slash:comments>1</slash:comments><comments>http://forums.xna.com/forums/thread/235785.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=235785</wfw:commentRss><description>&lt;div&gt;Sorry for the cross-post... meant to post this here...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Hello!  I&amp;#39;m working on a Surface app that involves some audio synthesis.  I&amp;#39;m trying to use DirectSound, but have had no luck.  This is my first C# app and while I&amp;#39;ve got the hang of most everything I&amp;#39;ve needed in XNA, the audio portion is killing me.  I absolutely must be able to do *synthesis* -- no WAV files.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Can anyone here recommend the best solution for this?  If DirectSound is the way to go, then please take a look here and let me know what I&amp;#39;m doing wrong.  This code runs, but I can&amp;#39;t hear anything.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="overflow-x:auto;overflow-y:auto;background-color:white;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-color:#7f9db9;border-right-color:#7f9db9;border-bottom-color:#7f9db9;border-left-color:#7f9db9;font-family:&amp;#39;courier new&amp;#39;;font-size:11px;"&gt;&lt;table cellpadding="0" cellspacing="0" style="width:99%;margin-top:2px;margin-right:0px;margin-bottom:2px;margin-left:0px;border-collapse:collapse;border-bottom-style:solid;border-bottom-color:#eeeeee;background-color:#ffffff;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;"&gt;                &lt;tr&gt;            &lt;td&gt;1&lt;/td&gt;            &lt;td&gt;&lt;span style="font-size:11px;"&gt;&lt;/span&gt;&lt;span style="color:green;"&gt;// Imports&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;2&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt;&lt;span style="font-size:11px;"&gt; Microsoft.DirectX.DirectSound; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;3&lt;/td&gt;            &lt;td&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt;&lt;span style="font-size:11px;"&gt; Microsoft.Xna.Framework; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;4&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;5&lt;/td&gt;            &lt;td&gt;&lt;span style="color:blue;"&gt;namespace&lt;/span&gt;&lt;span style="font-size:11px;"&gt; Orchestra.Audio &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;6&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;{ &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;7&lt;/td&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;8&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;    &lt;span style="color:green;"&gt;// The class&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;9&lt;/td&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;public&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;class&lt;/span&gt;&lt;span style="font-size:11px;"&gt; Sample : Game &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;10&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;    { &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;11&lt;/td&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;12&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;        &lt;span style="color:green;"&gt;// Constructor&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;13&lt;/td&gt;            &lt;td&gt;        &lt;span style="color:blue;"&gt;public&lt;/span&gt;&lt;span style="font-size:11px;"&gt; Sample(&lt;/span&gt;&lt;span style="color:blue;"&gt;double&lt;/span&gt;&lt;span style="font-size:11px;"&gt; frequency, &lt;/span&gt;&lt;span style="color:blue;"&gt;double&lt;/span&gt;&lt;span style="font-size:11px;"&gt; time) { &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;14&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;15&lt;/td&gt;            &lt;td&gt;            &lt;span style="color:green;"&gt;// Set up device&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;16&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;            Device device = &lt;span style="color:blue;"&gt;new&lt;/span&gt;&lt;span style="font-size:11px;"&gt; Device(); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;17&lt;/td&gt;            &lt;td&gt;            device.SetCooperativeLevel(&lt;span style="color:blue;"&gt;this&lt;/span&gt;&lt;span style="font-size:11px;"&gt;.Window.Handle, CooperativeLevel.Priority); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;18&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;19&lt;/td&gt;            &lt;td&gt;            &lt;span style="color:green;"&gt;// Set up wave format&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;20&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;            WaveFormat wf = &lt;span style="color:blue;"&gt;new&lt;/span&gt;&lt;span style="font-size:11px;"&gt; WaveFormat(); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;21&lt;/td&gt;            &lt;td&gt;            wf.AverageBytesPerSecond = 88200; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;22&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;            wf.BitsPerSample = 16; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;23&lt;/td&gt;            &lt;td&gt;            wf.BlockAlign = 2; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;24&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;            wf.SamplesPerSecond = 44100; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;25&lt;/td&gt;            &lt;td&gt;            wf.Channels = 1; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;26&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;            wf.FormatTag = WaveFormatTag.Pcm; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;27&lt;/td&gt;            &lt;td&gt;             &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;28&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;            &lt;span style="color:green;"&gt;// Set up buffer description&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;29&lt;/td&gt;            &lt;td&gt;            BufferDescription bd = &lt;span style="color:blue;"&gt;new&lt;/span&gt;&lt;span style="font-size:11px;"&gt; BufferDescription(wf); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;30&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;            bd.BufferBytes = (&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt;)(time * wf.SamplesPerSecond); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;31&lt;/td&gt;            &lt;td&gt;            bd.Control3D = &lt;span style="color:blue;"&gt;false&lt;/span&gt;&lt;span style="font-size:11px;"&gt;; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;32&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;            bd.ControlEffects = &lt;span style="color:blue;"&gt;true&lt;/span&gt;&lt;span style="font-size:11px;"&gt;; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;33&lt;/td&gt;            &lt;td&gt;            bd.ControlFrequency = &lt;span style="color:blue;"&gt;true&lt;/span&gt;&lt;span style="font-size:11px;"&gt;; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;34&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;            bd.ControlPan = &lt;span style="color:blue;"&gt;true&lt;/span&gt;&lt;span style="font-size:11px;"&gt;; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;35&lt;/td&gt;            &lt;td&gt;            bd.ControlVolume = &lt;span style="color:blue;"&gt;true&lt;/span&gt;&lt;span style="font-size:11px;"&gt;; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;36&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;37&lt;/td&gt;            &lt;td&gt;            &lt;span style="color:green;"&gt;// Set up buffer&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;38&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;            SecondaryBuffer buffer = &lt;span style="color:blue;"&gt;new&lt;/span&gt;&lt;span style="font-size:11px;"&gt; SecondaryBuffer(bd, device); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;39&lt;/td&gt;            &lt;td&gt;            buffer.Volume = (&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt;)Volume.Max; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;40&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;            buffer.Frequency = (&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt;)frequency; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;41&lt;/td&gt;            &lt;td&gt;            System.Console.WriteLine((&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt;)frequency); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;42&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;43&lt;/td&gt;            &lt;td&gt;            &lt;span style="color:green;"&gt;// Play sound&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;44&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;            buffer.Play(0, BufferPlayFlags.Default); &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;45&lt;/td&gt;            &lt;td&gt;         &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;46&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;        } &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;47&lt;/td&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;48&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;    } &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;49&lt;/td&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;50&lt;/td&gt;            &lt;td style="background-color:#f7f7f7;"&gt;} &lt;/td&gt;        &lt;/tr&gt;    &lt;/table&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;</description></item><item><title>question about going from dsound to xaudio2 - 3d sounds</title><link>http://forums.xna.com/forums/thread/233318.aspx</link><pubDate>Thu, 01 Oct 2009 22:02:46 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:233318</guid><dc:creator>sirlemonhead</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/233318.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=233318</wfw:commentRss><description>Hey,

I&amp;#39;m still struggling with XAudio2, after converting to it from direct sound. XAudio2 is a really nice api - I have my streaming background music playback working perfectly, but i&amp;#39;m having trouble with the actual 3d sound playback. When I try to use 3d positioning, the sounds play back very distorted, as if they&amp;#39;re playing too loudly but are clipping at a maximum volume level.

Can I just get something confirmed?

Say I have a certain number of sounds I want to position in 3d space, and have them pan, decrease in volume when you move further away from them, etc.. Is the below exactly what I need to do?

1: Have a listener, which represents my player. Every frame or so, update the listener to where the player is positioned in terms of x, y and z. Also, set the top and front orientation of the listener (the code did this originally with dsound)

2: then, for each 3d sound I want to play, I then have an emitter for each sound which I also update per frame, with the sounds 3d x,y and z location. Then, for each sound, once the emitter is updated, call X3DAudioCalculate passing in the listener (my player) struct, the current sound&amp;#39;s emitter, and some flags (what should I set for that, If I just want basic non reverbed positioning? I&amp;#39;m using only X3DAUDIO_CALCULATE_MATRIX at the moment)

then, when that&amp;#39;s done, call SetOutputMatrix. This is done for each sound after the X3DAudioCalculate function is called.

Is this right? This will properly pan and attenuate my sounds? I can get the code up if someone wants to see but there&amp;#39;s quite a lot of it. 

I&amp;#39;d just like some confirmation that i&amp;#39;m doing the right thing so far :) thanks!</description></item><item><title>Problem with manually looping xWMA file</title><link>http://forums.xna.com/forums/thread/148740.aspx</link><pubDate>Wed, 11 Mar 2009 13:45:22 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:148740</guid><dc:creator>StevenRS</dc:creator><slash:comments>3</slash:comments><comments>http://forums.xna.com/forums/thread/148740.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=148740</wfw:commentRss><description>I have a problem with manually looping xWMA files. DirectX documentation suggests that if xWMA data is submitted as more than one buffer (as in case of streamed files), then the sound can only be
looped manually by resubmiting the series of xWMA buffers. Consider the following code:&lt;br /&gt;
&lt;br /&gt;
XAUDIO2_BUFFER buffer = { 0 };&lt;br /&gt;
buffer.pAudioData = someData; // someData contains the whole xWMA file data chunk.&lt;br /&gt;
buffer.AudioBytes = someDataSize;&lt;br /&gt;
&lt;br /&gt;
XAUDIO2_BUFFER_WMA bufferWma = { 0 };&lt;br /&gt;
bufferWma.pDecodedPacketCumulativeBytes = someWmaData; // whole dpds chunk.&lt;br /&gt;
bufferWma.PacketCount = numWmaPackets;&lt;br /&gt;
&lt;br /&gt;
myVoice-&amp;gt;SubmitSourceBuffer( &amp;amp;buffer, &amp;amp;bufferWma ); // myVoice is IXAudio2SourceVoice*.&lt;br /&gt;
myVoice-&amp;gt;SubmitSourceBuffer( &amp;amp;buffer, &amp;amp;bufferWma );&lt;br /&gt;
buffer.Flags = XAUDIO2_END_OF_STREAM;&lt;br /&gt;
myVoice-&amp;gt;SubmitSourceBuffer( &amp;amp;buffer, &amp;amp;bufferWma );&lt;br /&gt;
&lt;br /&gt;
In this example, the whole file is loaded and looped manually. The first buffer is always played OK, but for every other buffer I get the following trace:&lt;br /&gt;
e:\dxsdk\nov08\audio\wma\codecv10\wmaudio\decoder\msaudiodec.cpp(2291) : *** TRACE *** code = 0x6!&lt;br /&gt;
&lt;br /&gt;
Same thing occurs when I split the file into several buffers (then the trace usually pops up when the second buffer of every loop iteration is being played back), but in this case there is an additional problem: OnBufferEnd callback is not called for some buffers and I suppose it is related to that trace. Does anybody has an idea why this may happen?&lt;br /&gt;
</description></item><item><title>Quick question regarding audio methods </title><link>http://forums.xna.com/forums/thread/231175.aspx</link><pubDate>Sun, 27 Sep 2009 08:33:47 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:231175</guid><dc:creator>TheMidnight</dc:creator><slash:comments>1</slash:comments><comments>http://forums.xna.com/forums/thread/231175.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=231175</wfw:commentRss><description>I am in the process of trying to create a basic audio engine that will allow for sound effects and music loops to be played. In order for the engine to function correctly on the Xbox 360 Arcade, do I need to do it using the XAct method or can I just do it using the SoundEffect type variable that is in the XNA framework. From what I have seen, the XAct method includes using a variable called AudioEngine and then plays sound effects using a Cue type variable. Just wondering if one of these is mandatory for the Xbox as I would hate to make something and then find out it only works on a windows version of the build. Thanks in advance.</description></item><item><title>help for sound noise suppression ... (directSound)</title><link>http://forums.xna.com/forums/thread/230293.aspx</link><pubDate>Thu, 24 Sep 2009 16:34:53 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:230293</guid><dc:creator>hadikazemi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/230293.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=230293</wfw:commentRss><description>hi&lt;br /&gt;
I used DirectSound for recording sound. I want to record only when
someone speeches not when she&amp;#39;s silent. So I checked average of capture
buffer. If it is between 123 and 132, sounds aren&amp;#39;t recorded:&lt;br /&gt;
&lt;pre&gt;for( cT = 0; cT &amp;lt; nSizeToWrite; cT++ )
{
	avg = avg + *((BYTE*)pbSrcData+cT);
}
avg = avg / nSizeToWrite;
		
if(avg &amp;gt; 132 || avg &amp;lt; 123 ){
//record in wave file.
...

&lt;/pre&gt;
&lt;br /&gt;
Unfortunately it doesn&amp;#39;t work properly. Silences are recorded mostly.
is that because of environment noise ? how can i suppression it?</description></item><item><title>how record only loud sound in directSound?</title><link>http://forums.xna.com/forums/thread/229657.aspx</link><pubDate>Wed, 23 Sep 2009 06:11:07 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:229657</guid><dc:creator>hadikazemi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/229657.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=229657</wfw:commentRss><description>hi&lt;br /&gt;
i write one DirectSound Program that record mic sound to wave file. now
i want to record only when sound is loud and dont record low sound.&lt;br /&gt;
&lt;br /&gt;
how can i do that?</description></item><item><title>Silly XAudio2 question regarding IXAudio2SourceVoice's - how many to use?</title><link>http://forums.xna.com/forums/thread/229018.aspx</link><pubDate>Mon, 21 Sep 2009 21:12:50 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:229018</guid><dc:creator>sirlemonhead</dc:creator><slash:comments>3</slash:comments><comments>http://forums.xna.com/forums/thread/229018.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=229018</wfw:commentRss><description>Hey,

I&amp;#39;m working on updating a game to use XAudio2 instead of Directsound. The way the game handles sounds is the standard affair - load some wav files, create dsound buffers for each and play them when required.

I&amp;#39;m a little confused about the source voices - should I create a source voice for every sound I&amp;#39;m loading? I&amp;#39;m sure I saw a post on a forum somewhere saying no to that, but I can&amp;#39;t find it now and i&amp;#39;m not 100% sure if that&amp;#39;s actually what they said.

If you&amp;#39;re not supposed to create source voices for all the sounds that can potentially play in your game, how do you handle it? Do you create a pool of source buffers and find an empty one to use when it comes to play a sound? Is it a bad idea to create and release source voices whenever they&amp;#39;re required or is there high overhead from doing this?

I&amp;#39;m still working on implementing XAudio2 so I haven&amp;#39;t had much of a chance to play around with this yet..any help would be appreciated!</description></item><item><title>Read MP3 files from an external player</title><link>http://forums.xna.com/forums/thread/227302.aspx</link><pubDate>Thu, 17 Sep 2009 11:09:46 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:227302</guid><dc:creator>ZioGico</dc:creator><slash:comments>3</slash:comments><comments>http://forums.xna.com/forums/thread/227302.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=227302</wfw:commentRss><description>&lt;span style="color:#000000;font-family:-webkit-monospace;font-size:16px;-webkit-border-horizontal-spacing:2px;-webkit-border-vertical-spacing:2px;"&gt;Hello everyone. First, I apologize for my English which is not very polished. &lt;br /&gt;I am a novice to XNA and I&amp;#39;m now approaching the technology. &lt;br /&gt;Let me know if I can play MP3 loading them from an external player (eg an iPod) connected to the USB port of my XBOX. If you like we do?&lt;/span&gt;&lt;div&gt;&lt;span style="font-family:-webkit-monospace;color:#000000;font-size:16px;-webkit-border-horizontal-spacing:2px;-webkit-border-vertical-spacing:2px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:-webkit-monospace;color:#000000;font-size:16px;-webkit-border-horizontal-spacing:2px;-webkit-border-vertical-spacing:2px;"&gt;thanks&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</description></item><item><title>xact auditioning tool vist</title><link>http://forums.xna.com/forums/thread/70498.aspx</link><pubDate>Mon, 23 Jun 2008 00:12:31 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:70498</guid><dc:creator>billq</dc:creator><slash:comments>3</slash:comments><comments>http://forums.xna.com/forums/thread/70498.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=70498</wfw:commentRss><description>&lt;p&gt;Hello,&amp;nbsp; I am unable to get the auditioning tool to work on my vista home laptop.&amp;nbsp; Whenever I try to play a sound the xact tool stops responding.&amp;nbsp; I have been doing some reading.&amp;nbsp; I have run both programs under administrators mode with the same result.&amp;nbsp; I also read that port 80 must be available.&amp;nbsp; when I run netstat -a -b I get some information on port 80.&amp;nbsp; It reads&lt;/p&gt;
&lt;p&gt;Active Connections&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Proto&amp;nbsp; Local Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreign Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; State&lt;br /&gt;
&amp;nbsp; TCP&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0.0.0:80&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bcq:0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LISTENING&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Can not obtain ownership information&lt;br /&gt;
My computer is named bcq.&amp;nbsp; I don&amp;#39;t know how to release this port to free it up for xact.&amp;nbsp; There is no program associated with it.&amp;nbsp; Any help would be greatly appreciated.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Bill&lt;/p&gt;
</description></item><item><title>XAudio2, XAPOFX Effects and VolumeCurves</title><link>http://forums.xna.com/forums/thread/225938.aspx</link><pubDate>Sun, 13 Sep 2009 12:57:44 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:225938</guid><dc:creator>Iveco</dc:creator><slash:comments>3</slash:comments><comments>http://forums.xna.com/forums/thread/225938.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=225938</wfw:commentRss><description>Hello,&lt;br /&gt;
&lt;br /&gt;
I am using XAudio2 and have two questions about the built-in effects.&lt;br /&gt;
&lt;br /&gt;
1) XAudio2 built-in effect: &amp;quot;Volume Meter&amp;quot;.&lt;br /&gt;
For what reason can this be useful or needed (in a game)? This can just display volume levels?&lt;br /&gt;
&lt;br /&gt;
2) In XAPO, there is a XAPOFX class having a few more effects. I do
understand these except one: &amp;quot;FXMasteringLimiter&amp;quot; -&amp;gt; A volume
limiter.&lt;br /&gt;
For what reason should I use a volume limiter, if I can control the
volumes manually on each SourceVoice? What kind of reason should I have
to put this on a MasteringVoice? What kind of goal can I reach with
this?&lt;br /&gt;
&lt;br /&gt;
Last but not least: Does someone have experiences with volumecurves in
XAudio2 (especially X3DAudio) to control the volume rolloffs per
distances? How do I set the maximum volume distance per each emitter,
does every emitter need to have it&amp;#39;s own volumecurve then? The
CurveDistanceScaler factor shouldn&amp;#39;t be changed, when it&amp;#39;s correctly
setup?&lt;br /&gt;
&lt;br /&gt;
Thanks for any help.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
&lt;br /&gt;
Iveco</description></item><item><title>ASSERT in XAudioD2_4.dll when playing xWMA stereo files</title><link>http://forums.xna.com/forums/thread/218716.aspx</link><pubDate>Tue, 25 Aug 2009 15:07:20 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:218716</guid><dc:creator>Iveco</dc:creator><slash:comments>1</slash:comments><comments>http://forums.xna.com/forums/thread/218716.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=218716</wfw:commentRss><description>Hello,&lt;br /&gt;
&lt;br /&gt;
I have a problem with the playback of stereo files with sample frequency of 44,1khz or 48khz encoded to xWMA.&lt;br /&gt;
Mono xWMA files do work fine and stereo up to 32khz. But files with 44,1/48khz always crash with an ASSERT as soon as the WAVEFORMATEX is sent to CreateSourceVoice().&lt;br /&gt;
&lt;br /&gt;
I am using the DirectX March 2009 SDK.&lt;br /&gt;
&lt;br /&gt;
################################################################################&lt;br /&gt;
### XAUDIO2: x2voicewma.cpp:223: &lt;br /&gt;
### ASSERT FAILED: InputWMAFormatInfo.wmaFormat.nBlockAlign == pSourceFormat-&amp;gt;nBlockAlign&lt;br /&gt;
################################################################################&lt;br /&gt;
&lt;br /&gt;
Here are some example values for the Format (WAVEFORMATEX) within the WAVEFORMATEXTENSIBLE:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wFormatTag&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;  353&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;nChannels&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;nSamplesPerSec&amp;nbsp;&amp;nbsp; 44100&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;nAvgBytesPerSec&amp;nbsp; 65488500&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;nBlockAlign&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 1485&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;wBitsPerSample&amp;nbsp;&amp;nbsp; &amp;nbsp;16&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cbSize&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;br /&gt;
&lt;br /&gt;
Anyone might have an idea what&amp;#39;s the cause of this? I am using the
xwmaencode.exe tool. I tried calculating the nBlockAlign value manually or directly using the information from the format header.&lt;br /&gt;
&lt;br /&gt;
Anyone might have a hint? Are 44,1khz or 48khz stereo files for xWMA not yet supported?&lt;br /&gt;</description></item><item><title>Loading songs asynchronously with MediaPlayer</title><link>http://forums.xna.com/forums/thread/227273.aspx</link><pubDate>Thu, 17 Sep 2009 08:07:56 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:227273</guid><dc:creator>cryo75</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/227273.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=227273</wfw:commentRss><description>As the title says.. is it possible?&lt;br /&gt;
&lt;br /&gt;
The problem is that the screen freezes for a sec or so till a 3mb mp3 is loaded.&lt;br /&gt;
&lt;br /&gt;
Ivan&lt;br /&gt;</description></item><item><title>Streaming ogg/vorbis in XAudio2</title><link>http://forums.xna.com/forums/thread/226616.aspx</link><pubDate>Tue, 15 Sep 2009 15:21:54 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:226616</guid><dc:creator>FireLancer</dc:creator><slash:comments>1</slash:comments><comments>http://forums.xna.com/forums/thread/226616.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=226616</wfw:commentRss><description>I want to stream some ogg/vorbis music in my game using XAudio2. Ive got something that works, however I have no idea how to make it work in cases where the bitrate is not constant, and have been unable to find any information on streaming variable bitrate audio in XAudio2 at all, even with a different format.&lt;br /&gt;
&lt;br /&gt;
My current code is as follows:&lt;br /&gt;
&lt;pre&gt;&lt;hr /&gt;
//Called periodically
bool AudioStream::update()
{
	XAUDIO2_VOICE_STATE state;
	voice-&amp;gt;GetState(&amp;amp;state);
	if(!almostDone)
	{
		if(state.BuffersQueued &amp;lt; BUFFER_COUNT - 1)
			fillBuffer();
	}
	else if(state.BuffersQueued == 0)
		finished = true;
	return !finished;
}
void AudioStream::fillBuffer()
{
	HRESULT hr;
	size_t readBytes;
	if(!readBlock(currentDiskReadBuffer, &amp;amp;readBytes))
		almostDone = true;
	assert(readBytes &amp;gt; 0);
	//submit buffer
	XAUDIO2_BUFFER buffer = {0};
	buffer.pAudioData = buffers[currentDiskReadBuffer];
	buffer.AudioBytes = readBytes;
	if(almostDone)
		buffer.Flags |= XAUDIO2_END_OF_STREAM;
	if(FAILED(hr = voice-&amp;gt;SubmitSourceBuffer(&amp;amp;buffer)))
		throw exception::DxError(hr);
	//cycle buffers
	(++currentDiskReadBuffer) %= BUFFER_COUNT;
}
void AudioStream::initStream()
{
	HRESULT hr;
	//create the source voice
	if(FAILED(hr = audio-&amp;gt;getXAudio()-&amp;gt;CreateSourceVoice(&amp;amp;voice, &amp;amp;format)))
		throw exception::DxError(hr);
	voice-&amp;gt;SetVolume(audio-&amp;gt;getMusicVolume(),audio-&amp;gt;getOpSet());
	//fill all the buffers
	for(unsigned i=0;iStart(0,audio-&amp;gt;getOpSet());&lt;br /&gt;	//add to audio object for updating/managing&lt;br /&gt;	audio-&amp;gt;addStream(this);&lt;br /&gt;}&lt;br /&gt;&lt;hr /&gt;
VorbisAudioStream::VorbisAudioStream(Audio *audio, const std::string &amp;amp;fileName)
:AudioStream(audio,&amp;quot;File: &amp;quot; + fileName)
{
	file = fopen(fileName.c_str(), &amp;quot;rb&amp;quot;);
	if(!file)throw exception::FileOpenError(fileName);
	ov_open_callbacks(file,&amp;amp;vorbisFile,0,0,OV_CALLBACKS_DEFAULT);
	info = ov_info(&amp;amp;vorbisFile, -1);
	
	memset(&amp;amp;format, 0, sizeof(format));
	format.cbSize          = sizeof(format);
	format.nChannels       = info-&amp;gt;channels;
	format.wBitsPerSample  = 16;//ogg/vorbis is always 16bit
	format.nSamplesPerSec  = info-&amp;gt;rate;
	format.nAvgBytesPerSec = format.nSamplesPerSec * format.nChannels * 2;
	format.nBlockAlign     = format.nChannels * 2;
	format.wFormatTag      = 1;
	
	initStream();
}
bool VorbisAudioStream::readBlock(int bufferId, size_t *readBytes)
{
	*readBytes = 0;
	int sec = 0;
	int ret = 1;
	memset(&amp;amp;buffers[bufferId], 0, BUFFER_SIZE);
	//Read in the bits
	while(ret &amp;gt; 0 &amp;amp;&amp;amp; (*readBytes)&amp;lt;BUFFER_SIZE)
	{
		ret = ov_read(&amp;amp;vorbisFile, (char*)buffers[bufferId]+(*readBytes),
			BUFFER_SIZE-(*readBytes), 0, 2, 1, &amp;amp;sec);
		*readBytes += ret;
	}
	return ret &amp;gt; 0;
}
&lt;/pre&gt;</description></item><item><title>XACT - can't connect to Windows auditioning service on Windows 7 x64</title><link>http://forums.xna.com/forums/thread/222171.aspx</link><pubDate>Wed, 02 Sep 2009 15:05:20 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:222171</guid><dc:creator>falc410</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/222171.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=222171</wfw:commentRss><description>Hi,&lt;br /&gt;
&lt;br /&gt;
I have the same problem as many other people but I haven&amp;#39;t been able to solve it. I can&amp;#39;t connect to the auditioning console on Windows 7 with XACT 3. It always tells me the same error that it can&amp;#39;t connect. Thanks to the other posts I heard that I need to close Skype - if I leave it open XACT just crashes - it doesn&amp;#39;t respond and needs to close. In my Windows Firewall I have an exception for XNA Gamestudio 3.1 Transport - I think this should be it. &lt;br /&gt;
I don&amp;#39;t have IIS installed I think even though I have the standard Windows 7 Prof. installation (yes it&amp;#39;s the final one, got it via MSDNAA). I don&amp;#39;t find any service for the ISS though, so I presume that it&amp;#39;s not installed.&lt;br /&gt;
My console just tells me: Waiting for the XACT authoring tool to connect. &lt;br /&gt;
But there never is any connection received.&lt;br /&gt;
&lt;br /&gt;
So anything else I can try to get this working?&lt;br /&gt;
&lt;br /&gt;
I tried to connecting to localhost as well, but I get the same error then. Oh and I have UAC turned off (at least it&amp;#39;s on the lowest slider, not sure if it 100% off at this point).&lt;br /&gt;
&lt;br /&gt;
EDIT: Gnah it really was my Firewall. The Entry is not the Transport but rather it should look like: XACT Auditioning Tool...I really wonder why the Firewall Window never popped upped - asking me to give the tool network access. Oh well.</description></item><item><title>Playback of a .wma file from a specific time</title><link>http://forums.xna.com/forums/thread/218635.aspx</link><pubDate>Tue, 25 Aug 2009 12:24:12 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:218635</guid><dc:creator>SmudgedCat</dc:creator><slash:comments>1</slash:comments><comments>http://forums.xna.com/forums/thread/218635.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=218635</wfw:commentRss><description>I&amp;#39;ve got a music track as a .wma file that I want to play in my game.  I want the track to loop but I don&amp;#39;t want it to loop right back to the beginning of the track.  I&amp;#39;ve loaded the track as Song using the the content processor and it looks like I should be able to find the end of the track by checking MediaPlayer.PlayPosition against Song.Duration.  However, there doesn&amp;#39;t seem to be a way of playing the song starting from a given position once this has happened, is this correct?&lt;br /&gt;
&lt;br /&gt;
Do I need to use XACT to do this and hence get my music in .wav format instead?&lt;br /&gt;
&lt;br /&gt;
Cheers,&lt;br /&gt;
&lt;br /&gt;
    Dave&lt;br /&gt;</description></item><item><title>Write Custom SoundEffect using XAPO?</title><link>http://forums.xna.com/forums/thread/218540.aspx</link><pubDate>Tue, 25 Aug 2009 03:01:23 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:218540</guid><dc:creator>hziee</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/218540.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=218540</wfw:commentRss><description>&lt;br /&gt;
I have read the xapo sample in DXSDK March2009,and know the frame how to do;&lt;br /&gt;
&lt;br /&gt;
But I still don&amp;#39;t understand the what is the data holds in the pInputProcessParameter.pBuffer,&lt;br /&gt;
&lt;br /&gt;
and how to process those datas to produce the effects ,like Low pass filther.&lt;br /&gt;
&lt;br /&gt;
are there an more samples ? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
here is the similar topic I found in the forums:&lt;br /&gt;
&lt;a href="http://forums.xna.com/forums/t/8716.aspx"&gt;http://forums.xna.com/forums/t/8716.aspx&lt;/a&gt;</description></item><item><title>Managed DirectSound CaptureBuffer.Read() help - Value does not fall within the expected range</title><link>http://forums.xna.com/forums/thread/207552.aspx</link><pubDate>Sun, 02 Aug 2009 00:02:10 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:207552</guid><dc:creator>aRottenKomquat</dc:creator><slash:comments>1</slash:comments><comments>http://forums.xna.com/forums/thread/207552.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=207552</wfw:commentRss><description>I&amp;#39;m working on a C# project that involves streaming audio over network streams, and all of my research has led me to use DirectSound for sound capture and playback. Unfortunately, I have been unable to find any tutorials on the web that make sense and many of them don&amp;#39;t even have code that works. Many of the Managed DirectSound MSDN pages complain that they don&amp;#39;t have US English versions, at least for me, so I haven&amp;#39;t read anything helpful there.&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;ve extracted some semi-working code from various tutorials but I&amp;#39;m having difficulty getting it to work.&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;ve created a Microphone class and a Speakers class. The problem I&amp;#39;m having is within the Microphone class, specifically using Microsoft.DirectX.DirectSound.CaptureBuffer.Read. When I call that method, I get an exception saying &amp;quot;Value does not fall within the expected range.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here&amp;#39;s some of the code from my Microphone class&amp;#39;s constructor, with the non-DirectSound stuff omitted.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WaveFormat format = new WaveFormat();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format.SamplesPerSecond = 22050;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format.BitsPerSample = 16;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format.Channels = 1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format.FormatTag = WaveFormatTag.Pcm;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format.BlockAlign = (short)(format.Channels * (format.BitsPerSample / 8));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format.AverageBytesPerSecond = format.SamplesPerSecond * format.BlockAlign;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int notifySize = Math.Max(4096, format.AverageBytesPerSecond / 4);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; notifySize -= notifySize % format.BlockAlign;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cap = new Capture();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CaptureBufferDescription capDesc = new CaptureBufferDescription();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; capDesc.Format = format;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; capDesc.BufferBytes = format.AverageBytesPerSecond / 5;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; capBuffer = new CaptureBuffer(capDesc, cap);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resetEvent = new AutoResetEvent(false);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; notify = new Notify(capBuffer);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BufferPositionNotify[] bpns = new BufferPositionNotify[4];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; bpns.Length; i++)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bpns[i] = new BufferPositionNotify();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bpns[i].Offset = (capBuffer.Caps.BufferBytes / 5) * (i + 1) - 1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bpns[i].EventNotifyHandle = resetEvent.SafeWaitHandle.DangerousGetHandle();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; notify.SetNotificationPositions(bpns);&lt;br /&gt;
&lt;br /&gt;
The microphone has a Thread which is responsible for capturing data from the microphone and sending it across the network stream. But here&amp;#39;s the DirectSound-relevant part of the Thread&amp;#39;s run function:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; capBuffer.Start(true);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int offset = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (_isEnabled)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resetEvent.WaitOne();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var data = capBuffer.Read(offset, typeof(byte), LockFlag.EntireBuffer, capBuffer.Caps.BufferBytes);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Some network code goes here, omitted for clarity.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; offset = (offset + capBuffer.Caps.BufferBytes / 5);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
capBuffer.Read always throws an exception, likely because I don&amp;#39;t really understand what the different parameters mean. I suspect the problem is the last parameter. At one point it did work but the sound was very echo-y and stuttered badly, probably because I don&amp;#39;t understand how to set up the buffers and such correctly.&lt;br /&gt;
&lt;br /&gt;
Can anybody with DirectSound experience help me? Links to any good tutorials, eBooks, and/or working code samples would be greatly appreciated. Also brief explanations of how I&amp;#39;m supposed to use capture buffers and what different parameters mean would be extremely helpful. I&amp;#39;m an experienced .NET developer but this DirectSound stuff is driving me up the wall. I&amp;#39;ve been messing with it all week and haven&amp;#39;t advanced much at all.&lt;br /&gt;
&lt;br /&gt;
Thanks in advance.&lt;br /&gt;</description></item><item><title>XAPO example code and related questions/general wonderings.</title><link>http://forums.xna.com/forums/thread/45650.aspx</link><pubDate>Wed, 13 Feb 2008 06:32:21 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:45650</guid><dc:creator>peter and lu</dc:creator><slash:comments>2</slash:comments><comments>http://forums.xna.com/forums/thread/45650.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=45650</wfw:commentRss><description>&lt;P&gt;In trying to implement an simple APO for use with XAudio2, I encountered a few problems, mainly because this is my first experience with COM interfaces. Having completed the APO I would like to demonstrate what I did to make it work, and get your feedback with regards to how I could have done it better. I see others have asked APO questions in the past, so I hope to lure out some experts and hear their concrete suggestions based on a simple example.&lt;/P&gt;
&lt;P&gt;The effect is a basic occlusion filter effect, using a one-pole low pass filter implemented by the APO. Code is at the end of this post.&lt;/P&gt;
&lt;P&gt;While implementing it I thought of the following questions:&lt;/P&gt;
&lt;P&gt;1) While it&amp;nbsp;was not too hard to implement the required COM interface once I had read a little about it, I wonder if it wouldnt be possible to&amp;nbsp;have the COM support in the &amp;nbsp;CXAPOBase class, or if it would be worth it for me to create another base effect class that handles this for me, if I need to implement many effects?&lt;/P&gt;
&lt;P&gt;2) Does it make sense to bypass the CXAPOBase class and work directly off the IXAPO interface, possibly implementing your own base class?&lt;/P&gt;
&lt;P&gt;3) Currently implementing only Process and LockForProcess is enough for me. Does anyone know of cases / have examples of more advanced APO´s where more of the interface is implemented?&lt;/P&gt;
&lt;P&gt;4) As far as I can see, the GUID create function CoCreateGuid is not available on the Xbox 360. I am just setting the ID to some value myself, can that cause any problems?&lt;/P&gt;
&lt;P&gt;I hope others can find the questions and code in this post relevant, and appologise for not being able to keep the post smaller :)&lt;/P&gt;
&lt;P&gt;- Peter&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;APO header:&lt;/P&gt;
&lt;DIV style="BACKGROUND-COLOR:white;"&gt;
&lt;TABLE style="BORDER-RIGHT:#e5e5e5 1px solid;BORDER-TOP:#e5e5e5 1px solid;BORDER-LEFT:#e5e5e5 1px solid;WIDTH:725px;BORDER-BOTTOM:#e5e5e5 1px solid;HEIGHT:858px;BACKGROUND-COLOR:white;" cellSpacing=0 cellPadding=0&gt;

&lt;TR style="VERTICAL-ALIGN:top;LINE-HEIGHT:normal;"&gt;
&lt;TD style="WIDTH:40px;TEXT-ALIGN:right;"&gt;&lt;PRE style="BORDER-RIGHT:#e7e7e7 1px solid;PADDING-RIGHT:2px;PADDING-LEFT:2px;FONT-SIZE:11px;PADDING-BOTTOM:2px;MARGIN:0px;COLOR:gray;PADDING-TOP:2px;FONT-FAMILY:courier new;"&gt;1&lt;BR&gt;2&lt;BR&gt;3&lt;BR&gt;4&lt;BR&gt;5&lt;BR&gt;6&lt;BR&gt;7&lt;BR&gt;8&lt;BR&gt;9&lt;BR&gt;10&lt;BR&gt;11&lt;BR&gt;12&lt;BR&gt;13&lt;BR&gt;14&lt;BR&gt;15&lt;BR&gt;16&lt;BR&gt;17&lt;BR&gt;18&lt;BR&gt;19&lt;BR&gt;20&lt;BR&gt;21&lt;BR&gt;22&lt;BR&gt;23&lt;BR&gt;24&lt;BR&gt;25&lt;BR&gt;26&lt;BR&gt;27&lt;BR&gt;28&lt;BR&gt;29&lt;BR&gt;30&lt;BR&gt;31&lt;BR&gt;32&lt;BR&gt;33&lt;BR&gt;34&lt;BR&gt;35&lt;BR&gt;36&lt;BR&gt;37&lt;BR&gt;38&lt;BR&gt;39&lt;BR&gt;40&lt;BR&gt;41&lt;BR&gt;42&lt;BR&gt;43&lt;BR&gt;44&lt;BR&gt;45&lt;BR&gt;46&lt;BR&gt;47&lt;BR&gt;48&lt;BR&gt;49&lt;BR&gt;50&lt;BR&gt;51&lt;BR&gt;52&lt;BR&gt;53&lt;BR&gt;54&lt;BR&gt;55&lt;BR&gt;56&lt;BR&gt;57&lt;BR&gt;58&lt;BR&gt; &lt;/PRE&gt;&lt;/TD&gt;
&lt;TD style="WIDTH:465px;"&gt;
&lt;DIV style="PADDING-RIGHT:2px;OVERFLOW-Y:hidden;PADDING-LEFT:8px;PADDING-BOTTOM:2px;MARGIN:0px;OVERFLOW:scroll;WIDTH:686px;PADDING-TOP:2px;HEIGHT:837px;"&gt;&lt;PRE&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;class&lt;/SPAN&gt; OcclusionFilterEffectXAudio2: &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;public&lt;/SPAN&gt; CXAPOBase, &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;public&lt;/SPAN&gt; IXAPOParameters {&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;public&lt;/SPAN&gt;:&lt;BR&gt;&amp;nbsp;&amp;nbsp;OcclusionFilterEffectXAudio2(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;const&lt;/SPAN&gt; XAPO_REGISTRATION_PROPERTIES *pRegProperties);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;virtual&lt;/SPAN&gt; ~OcclusionFilterEffectXAudio2() {}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:green;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;// XAPO methods&lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;STDMETHOD_(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;void&lt;/SPAN&gt;, Process) (UINT32 InputProcessParameterCount, XAPO_PROCESS_BUFFER_PARAMETERS** ppInputProcessParameters, UINT32 OutputProcessParameterCount, XAPO_PROCESS_BUFFER_PARAMETERS** ppOutputProcessParameters);&lt;BR&gt;&amp;nbsp;&amp;nbsp;STDMETHOD(LockForProcess) (UINT32 InputLockedParameterCount, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS** ppInputProcessParameters, UINT32 OutputLockedParameterCount, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS** ppOutputProcessParameters);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:green;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;// COM interface methods.&lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;STDMETHOD_(ULONG, Release) () {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--referenceCount;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;if&lt;/SPAN&gt; ( referenceCount == 0 ) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delete &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;this&lt;/SPAN&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;return&lt;/SPAN&gt; 0;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;return&lt;/SPAN&gt; referenceCount;&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;STDMETHOD_(ULONG, AddRef) () {&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;return&lt;/SPAN&gt; ++referenceCount;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;STDMETHOD(QueryInterface) (&amp;nbsp;&amp;nbsp;REFIID riid, &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;void&lt;/SPAN&gt; **ppvObject) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*ppvObject &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; NULL;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;if&lt;/SPAN&gt;(riid == IID_IUnknown) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*ppvObject &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; (IUnknown*)(IXAPO*)&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;this&lt;/SPAN&gt;;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;else&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;if&lt;/SPAN&gt;(riid == IID_IXAPO) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*ppvObject &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; (IXAPO*)&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;this&lt;/SPAN&gt;;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;else&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;if&lt;/SPAN&gt;(riid == IID_IXAPOParameters) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*ppvObject &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; (IXAPOParameters*)&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;this&lt;/SPAN&gt;;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;if&lt;/SPAN&gt;(*ppvObject( !&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; NULL)) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;((IUnknown*)(*ppvObject))-&amp;gt;AddRef();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;return&lt;/SPAN&gt; S_OK;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;return&lt;/SPAN&gt; E_NOINTERFACE;&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:green;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;// Parameter Interface implementation.&lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:green;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;// Expects to handle a single floating point value (occlusionLevel).&lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;STDMETHOD_(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;void&lt;/SPAN&gt;, GetParameters)&amp;nbsp;&amp;nbsp;( &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;void&lt;/SPAN&gt; *pParameters, UINT32 ParametersByteSize ) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;assert(ParametersByteSize == 4); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt;(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt;*)pParameters &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; occlusionLevel;&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;STDMETHOD_(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;void&lt;/SPAN&gt;, SetParameters)&amp;nbsp;&amp;nbsp;(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;const&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;void&lt;/SPAN&gt; *pParameters, UINT32 ParametersByteSize ) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;assert(ParametersByteSize == 4);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;occlusionLevel &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt;((&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt;*)pParameters);&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;private&lt;/SPAN&gt;:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt; referenceCount;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt; channels;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt; bytesPerSample;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; occlusionLevel;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; lastOutput[6];&lt;BR&gt;};&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;P&gt;APO Implementation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="BACKGROUND-COLOR:white;"&gt;
&lt;TABLE style="BORDER-RIGHT:#e5e5e5 1px solid;BORDER-TOP:#e5e5e5 1px solid;BORDER-LEFT:#e5e5e5 1px solid;WIDTH:525px;BORDER-BOTTOM:#e5e5e5 1px solid;BACKGROUND-COLOR:white;" cellSpacing=0 cellPadding=0&gt;

&lt;TR style="VERTICAL-ALIGN:top;LINE-HEIGHT:normal;"&gt;
&lt;TD style="WIDTH:40px;TEXT-ALIGN:right;"&gt;&lt;PRE style="BORDER-RIGHT:#e7e7e7 1px solid;PADDING-RIGHT:2px;PADDING-LEFT:2px;FONT-SIZE:11px;PADDING-BOTTOM:2px;MARGIN:0px;COLOR:gray;PADDING-TOP:2px;FONT-FAMILY:courier new;"&gt;1&lt;BR&gt;2&lt;BR&gt;3&lt;BR&gt;4&lt;BR&gt;5&lt;BR&gt;6&lt;BR&gt;7&lt;BR&gt;8&lt;BR&gt;9&lt;BR&gt;10&lt;BR&gt;11&lt;BR&gt;12&lt;BR&gt;13&lt;BR&gt;14&lt;BR&gt;15&lt;BR&gt;16&lt;BR&gt;17&lt;BR&gt;18&lt;BR&gt;19&lt;BR&gt;20&lt;BR&gt;21&lt;BR&gt;22&lt;BR&gt;23&lt;BR&gt;24&lt;BR&gt;25&lt;BR&gt;26&lt;BR&gt;27&lt;BR&gt;28&lt;BR&gt;29&lt;BR&gt;30&lt;BR&gt;31&lt;BR&gt;32&lt;BR&gt;33&lt;BR&gt;34&lt;BR&gt;35&lt;BR&gt;36&lt;BR&gt;37&lt;BR&gt;38&lt;BR&gt;39&lt;BR&gt;40&lt;BR&gt;41&lt;BR&gt;42&lt;BR&gt;43&lt;BR&gt;44&lt;BR&gt;45&lt;BR&gt;46&lt;BR&gt;47&lt;BR&gt;48&lt;BR&gt;49&lt;BR&gt;50&lt;BR&gt;51&lt;BR&gt;52&lt;BR&gt;53&lt;BR&gt;54&lt;BR&gt;55&lt;BR&gt;56&lt;BR&gt;57&lt;BR&gt;58&lt;BR&gt; &lt;/PRE&gt;&lt;/TD&gt;
&lt;TD style="WIDTH:465px;"&gt;
&lt;DIV style="PADDING-RIGHT:2px;OVERFLOW-Y:hidden;PADDING-LEFT:8px;PADDING-BOTTOM:2px;MARGIN:0px;OVERFLOW:scroll;WIDTH:715px;PADDING-TOP:2px;HEIGHT:739px;"&gt;&lt;PRE&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;OcclusionFilterEffectXAudio2::OcclusionFilterEffectXAudio2(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;const&lt;/SPAN&gt; XAPO_REGISTRATION_PROPERTIES *pRegProperties) :CXAPOBase(pRegProperties) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;referenceCount &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0;&lt;BR&gt;&amp;nbsp;&amp;nbsp;occlusionLevel &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0.5f;&lt;BR&gt;&amp;nbsp;&amp;nbsp;channels &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 1;&lt;BR&gt;&amp;nbsp;&amp;nbsp;bytesPerSample &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 4;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;lastOutput[0] &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0.0f;&lt;BR&gt;&amp;nbsp;&amp;nbsp;lastOutput[1] &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0.0f;&lt;BR&gt;&amp;nbsp;&amp;nbsp;lastOutput[2] &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0.0f;&lt;BR&gt;&amp;nbsp;&amp;nbsp;lastOutput[3] &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0.0f;&lt;BR&gt;&amp;nbsp;&amp;nbsp;lastOutput[4] &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0.0f;&lt;BR&gt;&amp;nbsp;&amp;nbsp;lastOutput[5] &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0.0f;&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;STDMETHODIMP OcclusionFilterEffectXAudio2::LockForProcess(UINT32 InputLockedParameterCount, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS** ppInputProcessParameters, UINT32 OutputLockedParameterCount, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS** ppOutputProcessParameters) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;channels &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; ppInputProcessParameters[0]-&amp;gt;pFormat-&amp;gt;nChannels;&lt;BR&gt;&amp;nbsp;&amp;nbsp;bytesPerSample &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; (ppInputProcessParameters[0]-&amp;gt;pFormat-&amp;gt;wBitsPerSample &amp;gt;&amp;gt; 3);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;return&lt;/SPAN&gt; CXAPOBase::LockForProcess(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;InputLockedParameterCount, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ppInputProcessParameters, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OutputLockedParameterCount, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ppOutputProcessParameters);&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;STDMETHODIMP_(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;void&lt;/SPAN&gt;) OcclusionFilterEffectXAudio2::Process(UINT32 InputProcessParameterCount, XAPO_PROCESS_BUFFER_PARAMETERS** ppInputProcessParameters, UINT32 OutputProcessParameterCount, XAPO_PROCESS_BUFFER_PARAMETERS** ppOutputProcessParameters) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;void&lt;/SPAN&gt;* pInputBuffer &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; ppInputProcessParameters[0]-&amp;gt;pBuffer;&lt;BR&gt;&amp;nbsp;&amp;nbsp;assert(pInputBuffer !&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; NULL);&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;void&lt;/SPAN&gt;* pOutputBuffer &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; ppOutputProcessParameters[0]-&amp;gt;pBuffer;&lt;BR&gt;&amp;nbsp;&amp;nbsp;assert(pOutputBuffer !&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; NULL);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:green;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;// one-pole low pass:&lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; sampleRate &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 48000.0f;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; cutOffFreq &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 500.0f;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; lowFrequencyRatio &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0.25f; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:green;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;// ie. attenuate -2.5db at f=0&lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;if&lt;/SPAN&gt;(occlusionLevel&amp;lt;0.01f) occlusionLevel &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0.01f;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;if&lt;/SPAN&gt;(occlusionLevel&amp;gt;0.99f) occlusionLevel &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 0.99f;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; w &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 2.0f &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt; PI &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt; cutOffFreq &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;/&lt;/SPAN&gt; sampleRate;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; g &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; (1.0f-occlusionLevel);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; cosw &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; Cos(w);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; a &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; (1.0f &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;-&lt;/SPAN&gt; g*cosw &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;-&lt;/SPAN&gt; Sqrt(2.0f*g*(1.0f-cosw)-g*g*(1.0f-cosw*cosw))) &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;/&lt;/SPAN&gt; (1.0f-g);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; k &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; g;&lt;BR&gt;&lt;BR&gt;    &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;for&lt;/SPAN&gt;(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt; i=0; i&amp;lt;channels; i++) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;for&lt;/SPAN&gt;(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;int&lt;/SPAN&gt; j=0; j&amp;lt;ppInputProcessParameters[0]-&amp;gt;ValidFrameCount; j++) {&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt; sample &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; ((&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt;*)pInputBuffer)[i*ppInputProcessParameters[0]-&amp;gt;ValidFrameCount &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; j];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lastOutput[i] &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; (1.0f-a) &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;*&lt;/SPAN&gt; sample &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; a*lastOutput[i];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;((&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;float&lt;/SPAN&gt;*)pOutputBuffer)[i*ppInputProcessParameters[0]-&amp;gt;ValidFrameCount &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;+&lt;/SPAN&gt; j] &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; lastOutput[i];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;ppOutputProcessParameters[0]-&amp;gt;ValidFrameCount &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; ppInputProcessParameters[0]-&amp;gt;ValidFrameCount; &lt;BR&gt;&amp;nbsp;&amp;nbsp;ppOutputProcessParameters[0]-&amp;gt;BufferFlags     &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; ppInputProcessParameters[0]-&amp;gt;BufferFlags;&lt;BR&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;P&gt;Effect chain setup:&lt;/P&gt;
&lt;DIV style="BACKGROUND-COLOR:white;"&gt;
&lt;DIV style="PADDING-RIGHT:2px;OVERFLOW-Y:hidden;PADDING-LEFT:8px;PADDING-BOTTOM:2px;MARGIN:0px;OVERFLOW:scroll;WIDTH:728px;PADDING-TOP:2px;HEIGHT:277px;BACKGROUND-COLOR:white;"&gt;&lt;PRE&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;XAUDIO2_EFFECT_DESCRIPTOR descriptor;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;descriptor.InitialState &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;true&lt;/SPAN&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;descriptor.OutputChannels &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 1;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IID apoIid &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; {1};&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:green;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;//CoCreateGuid( (GUID*)(&amp;amp;apoIid) );&lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rep &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; NEW(ALLOC_LIBS_SOUND, ALLOCATOR_DEFAULT, CXAPORegistrationProperties&amp;lt;1&amp;gt;( apoIid, L&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:#666666;FONT-FAMILY:Courier New;BACKGROUND-COLOR:#e4e4e4;"&gt;"Occlusion Filter APO"&lt;/SPAN&gt;, L&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:#666666;FONT-FAMILY:Courier New;BACKGROUND-COLOR:#e4e4e4;"&gt;"Deadline Games A/S, 2008"&lt;/SPAN&gt;, XAPO_FLAG_DEFAULT, 1, 1));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;occlusionFilterAPO &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; NEW(ALLOC_LIBS_SOUND, ALLOCATOR_DEFAULT, OcclusionFilterEffectXAudio2((&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;const&lt;/SPAN&gt; XAPO_REGISTRATION_PROPERTIES*)(rep)));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;occlusionFilterAPO-&amp;gt;Initialize(NULL, 0);&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;descriptor.pEffect &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; (CXAPOBase*)(occlusionFilterAPO);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;occlusionFilterAPO-&amp;gt;AddRef();&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XAUDIO2_EFFECT_CHAIN chain;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;chain.EffectCount &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; 1;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;chain.pEffectDescriptors &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &amp;amp;descriptor;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xaudio2Check(sourceVoice-&amp;gt;SetEffectChain(&amp;amp;chain));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;occlusionFilterAPO-&amp;gt;Release();&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description></item><item><title>playing wma file with XAudio2 </title><link>http://forums.xna.com/forums/thread/60221.aspx</link><pubDate>Mon, 05 May 2008 10:56:41 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:60221</guid><dc:creator>kamenkova</dc:creator><slash:comments>8</slash:comments><comments>http://forums.xna.com/forums/thread/60221.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=60221</wfw:commentRss><description>Hello All!&lt;br /&gt;Help me please. How to play .wma file with XAudio2? (not XACT)  </description></item><item><title>XAudio2 Access violation reading location on Xbox</title><link>http://forums.xna.com/forums/thread/216822.aspx</link><pubDate>Thu, 20 Aug 2009 14:46:05 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:216822</guid><dc:creator>RichardMonette</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/216822.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=216822</wfw:commentRss><description>I am trying to setup XAudio correctly on the Xbox using C++. My code is running fine on the PC but when I try and properly shutdown XAudio on the Xbox I get an access violation. &lt;br /&gt;
&lt;br /&gt;
All I am doing is basically the Xbox SDK example, &lt;br /&gt;
&lt;br /&gt;
m_MasterVoice-&amp;gt;DestroyVoice();&lt;br /&gt;
m_XAudio2-&amp;gt;Release();&lt;br /&gt;
&lt;br /&gt;
If I remove the DestroyVoice() then the crash goes away. I realize that the Release() call on the XAudio interface should release all my voices anways but I am trying to get everything working without this weird issue.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="border:1px solid #7f9db9;overflow:auto;background-color:white;font-family:courier new;font-size:11px;"&gt;
&lt;table cellspacing="0" cellpadding="0" style="border-width:0px;border-bottom:0px solid #eeeeee;margin:2px 0px;width:99%;border-collapse:collapse;background-color:#ffffff;"&gt;
    
    
        &lt;tr&gt;
            &lt;td&gt;&lt;span style="font-size:11px;"&gt;First-chance&amp;nbsp;exception&amp;nbsp;at&amp;nbsp;0x8352BCE4&amp;nbsp;&lt;/span&gt;&lt;span style="color:blue;"&gt;in&lt;/span&gt;&lt;span style="font-size:11px;"&gt;&amp;nbsp;E:\Project\RichardMonette\&lt;span style="font-size:11px;"&gt;Project&lt;/span&gt;_D.xex:&amp;nbsp;0xC0000005:&amp;nbsp;Access&amp;nbsp;violation&amp;nbsp;reading&amp;nbsp;location&amp;nbsp;0x0000002D.&amp;lt;br&amp;gt;Unhandled&amp;nbsp;XAPI&amp;nbsp;Exception.&amp;nbsp;Exception&amp;nbsp;Pointers&amp;nbsp;=&amp;nbsp;0x7004DA40&amp;lt;br&amp;gt;Code&amp;nbsp;c0000005&amp;nbsp;Addr&amp;nbsp;8352BCE4&amp;lt;br&amp;gt;Info0&amp;nbsp;00000000&amp;nbsp;Info1&amp;nbsp;0000002D&amp;nbsp;Info2&amp;nbsp;4058E0A0&amp;nbsp;Info3&amp;nbsp;7004F410&amp;lt;br&amp;gt;Unhandled&amp;nbsp;exception&amp;nbsp;at&amp;nbsp;0x8352BCE4&amp;nbsp;&lt;/span&gt;&lt;span style="color:blue;"&gt;in&lt;/span&gt;&lt;span style="font-size:11px;"&gt;&amp;nbsp;E:\&lt;span style="font-size:11px;"&gt;Project&lt;/span&gt;\RichardMonette\&lt;span style="font-size:11px;"&gt;Project&lt;/span&gt;_D.xex:&amp;nbsp;0xC0000005:&amp;nbsp;Access&amp;nbsp;violation&amp;nbsp;reading&amp;nbsp;location&amp;nbsp;0x0000002D.&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
    
&lt;/table&gt;
&lt;/div&gt;</description></item><item><title>XAudio2 and DirectX9 in same application causes performance hit under Vista</title><link>http://forums.xna.com/forums/thread/216114.aspx</link><pubDate>Wed, 19 Aug 2009 00:28:04 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:216114</guid><dc:creator>LJJ</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/216114.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=216114</wfw:commentRss><description>Hi:&lt;br /&gt;
I have an application that displays waveforms using DX9 and plays alarm sounds using XAudio2 - both accessed through the applicable SlimDX wrapper. On a fairly standard Dell desktop, I get the following CPU usage numbers for this app:&lt;br /&gt;
&lt;br /&gt;
a. If only the waveforms are drawing - 0% - 1%&lt;br /&gt;
b. If only the sound is playing - 0% - 1%&lt;br /&gt;
c. If both the waveforms are drawing and the alarm sounds are playing (actually it only needs the MasteringVoice to be instantiated), - 8% - 9%&lt;br /&gt;
&lt;br /&gt;
Thus, the sum is **far** worst than the parts. &lt;br /&gt;
&lt;br /&gt;
It is noticeable that the interrupts/second on the computer increases significantly when the alarm sounds are playing. &lt;br /&gt;
&lt;br /&gt;
These numbers are seen under Vista and System 7, but the effect is far less obvious under XP. Is this problem occurring because hardware assist for sound has been removed from Vista ? &lt;br /&gt;
&lt;br /&gt;
Anyone know of any way around this ? &lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
Lionel&lt;br /&gt;</description></item><item><title>Problem. DX11 can not mix one secondary buffer to more than 1 loudspeaker ?</title><link>http://forums.xna.com/forums/thread/201975.aspx</link><pubDate>Tue, 21 Jul 2009 17:55:03 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:201975</guid><dc:creator>Oleksiy Frolov</dc:creator><slash:comments>5</slash:comments><comments>http://forums.xna.com/forums/thread/201975.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=201975</wfw:commentRss><description>Hello &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; I am playing a secondary buffer using the &amp;quot;WAVEFORMATEXTENSIBLE&amp;quot;&amp;nbsp; to some particular loudspeakers in the 5.1 system&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;When migrated from Windows XP (DX9) to Windows 7 (DX11), the same code stopped working as follows:&lt;br /&gt;
&lt;br /&gt;
CreateSoundBuffer fails if I specify that playback should be to more than 1 loudspeaker, using the WAVEFORMATEXTENSIBLE format. For example:&lt;br /&gt;
&lt;br /&gt;
.dwChannelMask =&amp;nbsp; SPEAKER_FRONT_LEFT;&amp;nbsp;&amp;nbsp; // WILL WORK&lt;br /&gt;
.dwChannelMask =&amp;nbsp; SPEAKER_FRONT_RIGHT;&amp;nbsp;&amp;nbsp; // WILL WORK&lt;br /&gt;
.dwChannelMask =&amp;nbsp;SPEAKER_FRONT_CENTER;&amp;nbsp;&amp;nbsp; // WILL WORK&lt;br /&gt;
.dwChannelMask =&amp;nbsp; SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;&amp;nbsp;&amp;nbsp; // WILL NOT WORK!!. E_INVALIDARG is returned.&lt;br /&gt;
&lt;br /&gt;
Anyone have any idea what&amp;#39;s a problem with it?&lt;br /&gt;
&lt;br /&gt;
Thank you&lt;br /&gt;
&lt;br /&gt;
regards,&lt;br /&gt;
Oleksiy&lt;br /&gt;</description></item><item><title>XACT freezes when connecting to local audio console (solved)</title><link>http://forums.xna.com/forums/thread/121306.aspx</link><pubDate>Mon, 22 Dec 2008 16:13:46 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:121306</guid><dc:creator>daviddq</dc:creator><slash:comments>3</slash:comments><comments>http://forums.xna.com/forums/thread/121306.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=121306</wfw:commentRss><description>&lt;br /&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;m new to XNA. I&amp;#39;m trying to put XACT to work but when I select &amp;quot;Audition\Connect to XXX (local)&amp;quot; it freezes, it seems like it&amp;#39;s not able to connect to local audio console. It happens in XACT 2.0 and 3.0 and Audio Consoles 9.20 and 9.25 running on Windows Vista. I&amp;#39;ve already tried to turn off firewall but the problem persists. Any idea?&lt;br /&gt;
&lt;br /&gt;
Regards.
</description></item><item><title>Direct Sound Ogg-Vorbis streaming not working on Quad-Core XP machines</title><link>http://forums.xna.com/forums/thread/207313.aspx</link><pubDate>Sat, 01 Aug 2009 08:33:05 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:207313</guid><dc:creator>vspencerACI</dc:creator><slash:comments>2</slash:comments><comments>http://forums.xna.com/forums/thread/207313.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=33&amp;PostID=207313</wfw:commentRss><description>&lt;span style="color:#000000;font-family:verdana;"&gt;Hey,&lt;br /&gt;&lt;br /&gt;I have been working on a C++ Direct Sound/Ogg-Vorbis player and was able to stream up to 4 ogg files and play them using secondary buffers.&lt;br /&gt;&lt;br /&gt;Everything was fine until I tried to run the program on a Quad-Core/XP machine. The play time is extremely reduced, i.e., an 8 sec long file is played in 4 sec or less. What&amp;#39;s strange is that the same code works on Dual-Core/XP, Quad-Core/Vista - same machine as the Quad-Core/XP, Dual-Core/Windows 7 and i7/Windows 7 machines.&lt;br /&gt;&lt;br /&gt;The specs for the Quad-Core/XP machine are:&lt;br /&gt;- 4GB RAM&lt;br /&gt;- Intel Core 2 Quad CPU Q9950&lt;br /&gt;- RealTek HD Audio&lt;br /&gt;&lt;br /&gt;If you need more information please let me know.&lt;br /&gt;&lt;br /&gt;Thanks for your help.&lt;br /&gt;V&lt;/span&gt;</description></item></channel></rss>