Forum Moderators: open
I've written an ASP script as to stream out mp3's at a controlled speed. It basically uses a ADODB to read the file then binary write's it out with some calculated pausing.
Everything seems perfect. It sends out the file with the same headers just as the IIS would normally send a mp3. However, even though I've strickly sent the content as an audio type, the browser just wants to download it as a file.
If I type the URL in to Quick Time is works perfectly. But if I type the URL in to the Windows Media Player, the server sends out the regulated stream to the client, but Media Player timeouts saying it failed to connect!
What else does Windows need to know as treat this as a playable mp3.
I'm wondering if its anything to do with some hidden DRM data somewhere. Is the IIS modifing the output of the mp3 file?
If the user has the "helper app" set in IE or FF that the browser is to open all MP3s in Winamp or automatically save to desktop... or whatever they have as the default action that is what will happen when they encounter your MP3.
For example, I have my parents computer set up to open any .doc or .docx file in MS Word, on my computer I have it set to save files to desktop and never open them. It works the same with MP3s.
Some alternatives:
You may want to look at using a windows streaming file extension which is .asx or you can use a standard one like .pls..
Or you can do this in flash... create a flash player and place it in your site, then make the audio file a .flv and stream that to the embedded flash player.
You can also embed a player like WMP into your site, but it can cause issues with different OSs... like if you embedded windows media player and someone on Linux or Mac visits your site they will have issues using the player.
Once HTML 5 becomes more used in IE you can look at using the audio element.
My browser does open the mp3 correctly if I link directly to the mp3 file. I just cant see how my browser can tell the difference between a direct link and my simulated direct link - as I have set identical header information.
It appears MS does some clever DRM which is unnecessary for my application. - its a complete mine field.
audio via the web is so rubbish! Dont like having to use different types of non-standard embed's. and flash files slow down page loading times too much. html5 handles things a lot better, but I would like to be compatible back to IE6.
I want a cross browser solution to streaming music whilst minimising copy'ing and bandwidth. Most current methods still streams the music far faster than its being played. MS Media streamer says it controls this - but I know for a fact it doesnt.
Still hoping to avoid using 3rd party stuff - off to look at Java methods now.
It should do what you want, I know people who use it and rave about it.
I know it slows sites down, but if you have a really light weight player it shouldn't be too bad. Remember that you can set it up so that the only flash on the page is a small player a few KB (I have one on a site that is 55KB).
Then you can stream the audio in an .flv and that will be the bulk of the file size, but it won't slow down your page loads if you don't queue the song until they click or until the page load is complete.
clever DRM
Is there such a thing?
Havent heard of Darwin, I will look it up.
You are right there is no built in stream control in flash. I think you need Flash MX to gain that level of control and it isn't free or even cheap.
I will dig around a bit more when I have time and see if there is something simple being missed.
Let me know if you have any Darwin questions also.