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


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



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?


ASP.NET MVC - TextArea values

1:

What's the difference between a Web Server and a Game Server?
I think I would look at a custom HttpHandler to did the actual streaming. C#: Caching w/ method attributes VS manually using System.Web.CachingTo me, it seems this the controller needs to be finished with any processing before handing off to the view or you will introduce a cross cutting concern.. Blank LogOn view in MVC application
return a list of string as JSONResult

82 out of 100 based on 67 user ratings 142 reviews

*