How to stream audio from ASP.NET MVC controller when it's still encoding?

Posted by kyrisu on Stack Overflow See other posts from Stack Overflow or by kyrisu
Published on 2010-05-26T22:45:58Z Indexed on 2010/05/26 22:51 UTC
Read the original article Hit count: 194

Filed under:
|

Background

I have wave files on my server that I want to stream. Because of the size I want to encode them to mp3.

I've tried to use

  • FileStreamResult - but it doesn't work because as soon as program leaves the controller stream is closed and I get - "Cannot access a closed stream"
  • FileContentResult - but it's not a stream and the user would need to wait for encoding to finish

Question

Is there a way to stream audio from the controller while it's still encoding?

© Stack Overflow or respective owner

Related posts about c#

Related posts about asp.net-mvc