c# - Playing .WAV file on Internet Explorer -


i trying play .wav file on internet explorer thru windows media player ( assuming default media player client machine )

view

 <a class="" href="@url.action("voicesample", "report", new { num = item.num })">play voice</a>         

report controller

    public filestreamresult voicesample(string num)     {         filestream fs = null;         string sfilename = "";                     string fnamewithfullpath = @"c:\test.wav";          fileinfo myfile = new fileinfo(fnamewithfullpath);         if (myfile.exists)         {                              fs = new filestream(fnamewithfullpath, filemode.open, fileaccess.read);             sfilename = "test.wav";         }                     return file(fs, "audio/x-wav");     } 

this works when run localhost, doesn't when publish code server , run server, windows media player opens , throws below error:-

"windows media player cannot play file. player might not support file type or might not support codec used compress file."

but again works if return file name below, internet explorer prompt open/save... options. want play click on link "play voice", don't want ie prompt.

   return file(fs, "audio/x-wav",sfilename ); 

what has done differently played when been running server?

just noticed , network tab on on dev toolbar (f12) see header responses same except x-sourcefiles not there when ran server.i think okay since happens when run localhost.

appreciate help!

thanks


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -