Fix: compile CSpeex audio codec at Silverlight 4 RC+ and Silverlight 5
Just added an issue to CSpeex project – http://cspeex.codeplex.com/workitem/18209 – with some fixes to make it compile for Silverlight 4 RC and higher (was for Silverlight 4 Beta).
1) at "MainPage.xaml.cs", replace with this method implementation:
private void TakeSnapshot_Click(object sender, RoutedEventArgs e)
{
if (_captureSource != null)
{
// capture the current frame and add it to our observable collection
_captureSource.CaptureImageCompleted += (source, eventargs) =>
{
_images.Add(eventargs.Result);
};//”ImageCaptureAsync" method replaced by "CaptureImageAsync" at Silverlight 4 RC
_captureSource.CaptureImageAsync();
}
}
2) at "StreamAudioSync.cs" do this small change:
protected override void OnFormatChange(AudioFormat audioFormat)
{
if (audioFormat.WaveFormat == WaveFormatType.Pcm)//”PCM" renamed to "Pcm" at Silverlight 4 RC (after SL4beta)
{
…
Note that the CSpeex-SL project won’t load if you don’t have Silverlight 3 SDK installed. After loading you can open up properties of that project and of SLAudioDemo one and set the target to Silverlight 5 from Silverlight 3, then save those two projects and rebuild the solution.