views:

603

answers:

4

So considering that Silverlight has a nice subset of the .net framework, you would think that it wouldn't be very difficult to play audio in reverse, right? Well no. I can't even find a good place to start. It doesn't seem like the MediaElement has the ability to play audio in reverse.

Does anyone have ANY CLUE how this can be done? Would this be easier to do in a .net winforms app?

TIA.

A: 

DirectX had quite a bit of audio abilities. I would check that or the new XNA framework.

Joshua Belden
+2  A: 

the mp3 format is not reversible

decode the mp3 to wav, reverse the order of the samples, re-encode to mp3, then play it

Steven A. Lowe
A: 

MP3 format is not encoded to be played in reverse. It would require you to decode, reverse, then re-encode, which will take a bit of time and CPU.

If I were you, I would just reverse the MP3 in an audio editor program, save it, then play that one in your application.

Nick Whaley
A: 

It should be possible to play MP3 in reverse. The audio data is stored in chunks. The chunks will need to be read in reverse order, decoded and passed to the MediaStreamSource in reverse PCM sample order.

The only issue is that the stream has to be first read in fully to be able to read it backwards later.

I've written an MP3 decoder for Silverlight here (source code will be uploaded shortly ). I think it should be easy for you to rewrite it to play an MP3 in reverse.

theahuramazda