尝试使用SharpDX在Windows Phone 8上进行FM合成

时间:2014-03-04 02:46:42

标签: c# windows-phone-8 sharpdx

我基本上是在stackoverflow上复制我在其他地方发现的代码并遇到问题。也许有人可以帮助我。

我已经看到这个代码模式在stackexchange上发布了几次关于SharpDX的信息:

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

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

这不适用于Windows Phone 8版本的SharpDX,因为ContextEventArgs不存在。问题是,这已经被弃用了另一种委托方式(我看到的帖子都超过了一年),还是完全没有WP8版本?真正的问题是,我如何在WP8上正确地做到这一点?

编辑:指向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/

1 个答案:

答案 0 :(得分:0)

到目前为止我还没有使用SharpDX,但是查看有关BufferStart事件定义的在线文档,您可以尝试以这种方式附加事件处理程序:

sourceVoice.BufferStart += sourceVoice_BufferStart;

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

无法提供完整的答案,只需轻轻推动可能修复错误。发布您引用的其他stackoverflow帖子的链接也可能会有所帮助。