Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think it's pretty safe to say that this is a bug in the framework. Because it's in the audio code, perhaps the framework is not handling something it's getting from a driver correctly. It's hard to say for sure.</p> <p>Suffice to say that an <code>AccessViolationException</code> coming out of the framework is not "normal". It's almost certainly <strong>not your fault</strong>.</p> <p>The function <code>IsEventRegistered</code> that the exception occurs in is an <code>unsafe</code> function. So it's likely that function is doing exactly what the exception says: it is accessing an invalid memory address.</p> <p>The exception is coming from the shutdown code for audio capture (microphone), so are you doing anything with the microphone in your code? You could possibly experiment with using/not using the microphone and see what happens.</p> <p>Also: does this happen when you run without the debugger attached? (Ctrl+F5)</p> <p><strong>As for fixing the problem:</strong> Your solution is not a bad work-around.</p> <p>If you cannot afford to wait the three seconds, and you want to get your hands dirty and write some <em>very questionable</em> (semi-unportable, not-necessaraly-forward-compatible) code: You could use reflection to access the private properties of the audio system. Find the list of <code>SoundEffectInstance</code> objects that are created internally whenever you call <code>SoundEffect.Play</code>, and then stop those instances before you shutdown.</p> <p>Or you could do effectively the same thing by never calling <code>Play</code>, but instead calling <code>CreateInstance</code> and managing fire-and-forget sound effects on your own. The downside is that this requires writing an awful lot of code!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload