如何在Windows Phone 8中集成音频捕获任务

时间:2014-06-06 10:59:45

标签: c# windows-phone-8

如何在Windows Phone 8中录制音频? 哪种方法有用?

看我的代码:

private Microphone _microphone;
private byte[] _buffer;
private TimeSpan _duration;

_microphone = Microphone.Default;
_microphone.BufferDuration = TimeSpan.FromMilliseconds(300);
_duration = _microphone.BufferDuration;
_buffer = new byte[_microphone.GetSampleSizeInBytes(_microphone.BufferDuration)];
_microphone.BufferReady += _microphone_BufferReady;
_microphone.Start();

void _microphone_BufferReady(object sender, EventArgs e)
{
    _microphone.GetData(_buffer);
}

0 个答案:

没有答案