http://bbs.51cto.com/archiver/tid-863385.html
void microphone_BufferReady(object sender, EventArgs e)
{
this.Dispatcher.BeginInvoke(() =>
{
microphone.GetData(buffer);
stream.Write(buffer, 0, buffer.Length);
TimeSpan tsTemp = timer.Elapsed;
TextBlockSeconds.Text = tsTemp.Hours.ToString().PadLeft(2, '0') + ":" + tsTemp.Minutes.ToString().PadLeft(2, '0') + ":" + tsTemp.Seconds.ToString().PadLeft(2, '0');
if(timer.Elapsed.Seconds >5)
DoStop();
});
}
private void ButtonRecord_Click(object sender, RoutedEventArgs e)
{
DisableRecordButton();
timer = new Stopwatch();
timer.Start();
stream = new MemoryStream();
TextBlockSeconds.Text = "00:00:00";
TextBlockStatus.Text = "Recording: ";
microphone.BufferDuration = TimeSpan.FromMilliseconds(500);
buffer = new byte[microphone.GetSampleSizeInBytes(microphone.BufferDuration)];
microphone.BufferReady += new EventHandler<EventArgs>(microphone_BufferReady);
microphone.Start();
}
private void DoStop()
{
if (timer.IsRunning)
timer.Stop();
if (microphone.State == MicrophoneState.Started)
{
microphone.Stop();
TextBlockStatus.Text = "Stopped: Ready to save";
}
else
{
TextBlockStatus.Text = "Ready: ";
}
TextBlockSeconds.Text = string.Empty;
EnableRecordButton();
}
http://www.cnblogs.com/zhangyafeng/archive/2009/12/10/1621213.html
http://www.devdiv.com/thread-23384-1-1.html
流媒體播放
http://www.silverlightchina.net/html/zhuantixilie/winphone7/2011/0930/10757.html
http://www.silverlightchina.net/plus/search.php?kwtype=0&keyword=%D2%F4%C6%B5&searchtype=titlekeyword
http://www.silverlightchina.net/plus/search.php?kwtype=0&keyword=Audio&searchtype=titlekeyword
http://www.silverlightchina.net/html/developer/silverlight/2010/0521/1166.html
http://www.cnblogs.com/imobiler/archive/2010/12/23/1914353.html