Guido Helmers
2006-Oct-30 13:48 UTC
[Icecast-dev] Streaming WAV / Converting WAV to a streamable format on the fly
Hi, I am trying to implement a web application that allows the user to playback WAV files inside a web browser. __________ Background __________ - The file server stores audio files as GSM 6.10 or TrueSpeech encoded WAV files. - The web server (most probably ASP.NET on IIS) offers the client the ability to search audio files on the file server (a different machine). - The client will be equiped with internet explorer and a standard Media Player plugin (preferably Windows Media Player or QuickTime). ____________ Requirements ____________ The requirements for this application are: 1. The client should be able to playback a WAV file with a media player plugin in the web browser. 2. The WAV file should NOT be accessible to the client, the URL to the WAV file should not be accessible / visible 3. The WAV file should NOT be downloaded 4. The WAV file should NOT be cached on the client hard disk ________________________ No Progressive download! ________________________ Because of requirement 2, we can NOT do this: <object id="player" height="45" width="220" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"> <param name="url" value="audio/GSM.wav" /> </object> because the user can copy-paste the file location from the source code, and easilly download the file. Because of requirement 3 and 4, pseudo streaming like the following (an asp.net example) is NOT allowed, because the complete file is still downloaded to the client: <object id="RPPlayer" height="200" width="220" classid="CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA"> <param name="type" value="audio/wav" /> <param name="src" value="audioStream.aspx" /> </object> code-behind page of audioStream.aspx: ... Response.ContentType = "audio/wav" Response.AddHeader("Content-Disposition", "attachment; filename=""GSM.wav""") Response.TransmitFile("C:\GSM.wav") ... _______________ Real Streaming? _______________ So having excluded downloading and pseudo-streaming (a.k.a. http-streaming a.k.a. progressive download) the logical next step is 'real' (on demand) streaming. The limitation that we come across when using standard Streaming Servers (like Windows Media Services or QuickTime) is that they can not stream WAV files. The WAV files always have to be encoded to a streamable format (WMA for windows media service, or MOV for QuickTime/Darwin, etc) before they can be streamed. Converting the complete file server from WAV to a streaming format (WMA, MOV or whatever) is not an option (because the file server is being populated with new WAV files continuously; this process is 'hardware-driven' and extremely hard to adjust). We will stick to the WAV file format for now. _________ Questions _________ So what I'm really looking for is one of the following: (a) a streaming server that can stream WAV files. Does this exist or is it technically impossible to stream WAV files? Why? (b) or a way to convert WAV to a streamable format on the fly (programmatically, 'inside' the streaming server), when the user requests the WAV file. I have no problem with converting WAV on the fly, - but the conversion should never take more than a few seconds for a one MB WAV file (= 10 minutes in our case), - and I would like to hear experiences from other developers that have done this, before I invest a lot of time in this and bump into unforeseen problems when I'm halfway. I noticed that a 10 minute WAV file which is 1MB in size takes about - 3 seconds to convert to MOV with QuickTime Pro (I think this can be programmed into the Darwin streaming server) - 25 seconds to convert to WMA with the Windows Media Encoder (could be programmed with the Windows Media SDK but 25 seconds takes way too much time) - Is there a way to programmatically convert to a format that can be streamed by icecast, on the fly? (c) or a completely different approach, like streaming over HTTP with to Java applet. I can not find any examples on the web, and think this might be the most time-consuming solution of all? Other helpful comments are also very welcome... Cheers, Guido _________________________________________________________________ Talk with your online friends with Messenger http://www.join.msn.com/messenger/overview