2014-03-04 82 views
1

我基本上覆制了我在其他地方找到的代碼,並且遇到了問題。也許有人可以幫助我。試圖在Sharp Phone上使用Windows Phone 8進行FM合成

我看到周圍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上正確地做到這一點?

編輯:鏈接到前面的問題上計算器: 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/

+0

更新後即可添加鏈接。 – yogsodoth

回答

0

我沒有用SharpDX到目前爲止,但是看一下在線文檔有關BufferStart事件定義,你可以嘗試以這種方式附加事件處理程序:

sourceVoice.BufferStart += sourceVoice_BufferStart; 

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

無法提供完整答案,只需輕輕一推即可大概修正了錯誤。張貼鏈接到您引用的其他stackoverflow帖子也可能有所幫助。