I need some technical help here

Talk about Audio On Demand or Streaming
Post Reply
NullPointer
Posts: 2
Joined: Sat Oct 26, 2002 6:17 pm

I need some technical help here

Post by NullPointer »

I'm tying to code my own Java Servlet based program to stream mp3 over the network. So far I've been able to use WinAmp's load location by URL feature to point to my servlet and play the mp3 and it plays fine. The problem I have is getting the browser to automatically load WinAmp when I try loading my servlet through there instead of through winamp. It will ask me to save the file instead of playing it directly as I can do on many web sites which use ShoutCast.

I assume the problem is with my content type header. I tried setting it to audio/mpeg but that didn't help. Someone on the winamp forum told me the way shoutCast does it is by generating a playlist file (.pls) and sending that which then references a url for my mp3 stream. I tried this but I don't know what content type playlist files are. In the windows registry it does not have a content type listed for it. Does anyone know what I should set the content type to so the broswer knows its a playlist and should open winamp?
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

it sounds like you are trying to link to the mp3 itself which is the wrong way to do this. You must link to a file that serves as a way to tell the Player where the mp3 is sort of like a reference file. To do this you use what are called playlist files like and M3U playlist or a PLS playlist. Inside these files you leave references to the mp3's themselves. Check out my article on these files here: http://forums.radiotoolbox.com/viewtopic.php?t=76
- Jay
NullPointer
Posts: 2
Joined: Sat Oct 26, 2002 6:17 pm

Post by NullPointer »

Great info, thanks Jay.

I now got it working, just have to play with buffer sizes and sampling rates to smooth out some studdering but at least its a start.
Post Reply