Question

I'm basically copying code I've found elsewhere on stackoverflow and running into issues. Perhaps someone can help me out here.

I've seen this code pattern posted around stackexchange with regards to SharpDX a couple of times:

sourceVoice.BufferStart += new EventHandler<ContextEventArgs>(sourceVoice_BufferStart);

private void sourceVoice_BufferStart(object sender, EventArgs e)
{
....event handler actions...
}

This doesn't work with the Windows Phone 8 version of SharpDX, because ContextEventArgs doesn't exist. The question is, has this been deprecated for another way of delegating (both posts I saw were more than a year old), or is it just missing entirely from the WP8 version? And the real question is, how would I go about doing this properly on WP8?

Edit: links to previous questions on stackoverflow: Playing sinus through XAudio2

Playing a sound from a generated buffer in a Windows 8 app

http://www.gamedev.net/topic/562982-slimdxxaudio2-playing-buffer-from-memory/

No correct solution

OTHER TIPS

I haven't used SharpDX so far, but looking at the online documentation about BufferStart event definition, you can try to attach event handler this way :

sourceVoice.BufferStart += sourceVoice_BufferStart;

private void sourceVoice_BufferStart(IntPtr e)
{
....event handler actions...
}

Can't help with complete answer, just a slight push that could probably fix the error. posting links to other stackoverflow posts you referenced could also be helpful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top