FIleStreamResult and Wavesurfer (ASP.NET) #4016
-
|
I have an MVC Web App Controller that returns a FileStreamResult. The link I use in Wavesurfer is the path to the controller. The wave file plays fine. But every time I interact (like click to skip ahead), the wave file gets reloaded from the controller. The player starts over and plays from the beginning of song... Is this a bug? A bad design? Is there a different approach to making this work as I don't want to expose the actual location of the wave files to the end user? I have pre-calculated peaks and duration. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Make sure your server sends the right content type for the audio. |
Beta Was this translation helpful? Give feedback.
If it plays fine but it's the seeking/scrubbing you have issues with, then it's probably Range headers that you're missing.
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range
Alternatively, you can switch to Web Audio (
backend: 'WebAudioin wavesurfer options). In that case the whole file will be downloaded and played from an in-memory buffer.