I have an mp3 file in my site. I want to output it as a view. In my controller I have:
public ActionResult Stream() { string file = \'test.mp3\';
You should return a FileResult instead of a ViewResult:
return File(stream.ToArray(), "audio/mpeg", "test.mp3");
The stream parameter should be a filestream or memorystream from the mp3 file.