我在Windows Phone 8应用中有以下代码:
FrameworkDispatcher.Update();
microphone = Microphone.Default;
microphone.BufferReady += Device_BufferReady;
bStarted = true;
tbData.Text = "00:00:00";
m_lDuration = 0;
microphone.BufferDuration = TimeSpan.FromMilliseconds(100);
baBuffer = new byte[microphone.GetSampleSizeInBytes(microphone.BufferDuration)];
microphone.Start();然而,Device_BufferReady永远不会被击中!你知道我做错了什么吗?
发布于 2013-06-30 04:56:41
开发中心(http://code.msdn.microsoft.com/wpapps/Microphone-Sample-b2ebe8b6)提供的示例代码使用了一个周期为33ms的滚动条,您可以从中调用FrameworkDispatcher.Update()方法...
// Timer to simulate the XNA Framework game loop (Microphone is
// from the XNA Framework). We also use this timer to monitor the
// state of audio playback so we can update the UI appropriately.
DispatcherTimer dt = new DispatcherTimer();
dt.Interval = TimeSpan.FromMilliseconds(33);
dt.Tick += delegate { try { FrameworkDispatcher.Update(); } catch { } };
dt.Start();这是你实现的吗?
https://stackoverflow.com/questions/17383420
复制相似问题