tags:

views:

30

answers:

1

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?

A: 

I think I would look at a custom HttpHandler to do the actual streaming. To me, it seems that the controller needs to be finished with any processing before handing off to the view or you will introduce a cross cutting concern.

Hal