views:

302

answers:

1

I have a Silverlight 4 application that records user's voice through the mic. Now, as soon as the recording is completed, I need to play the recorded voice back to the user before posting it to the server. Is it at all possible to play it back to the user without getting into format conversions etc? Any ideas are welcome. Thanks!

+2  A: 

Hi Ramesh,

I believe you can create a MediaElement control, and then use it's SetSource() method to pass it the stream containing the data your application has received via CaptureSource.

For example:

MediaElement.SetSource(Stream yourStream);

Does this help?

Richard
I'm sorry to report that that strategy hasn't worked. Thanks anyway, Richard.
Ramesh
Sorry, Ramesh - I'd assumed you were already encoding the raw PCM data from the CaptureSource() into something that MediaElement can play, like .WAV. This is well documented on the web, but if you're after a quick solution you can check http://code.msdn.microsoft.com/wavmss for an AudioSink that you can use to do this for you. Then you can pick up where I left you and use .SetSource(Stream yourWavStream).
Richard