dubrie
12-12-2004, 02:06 AM
Does anyone know a way (hopefully simple) to stream audio from a UNIX based web page? I have been trying to find out a suitable way to do this but it never ends up correct in the end. Thanks!
![]() | View Full Version : Streaming Audio dubrie 12-12-2004, 02:06 AM Does anyone know a way (hopefully simple) to stream audio from a UNIX based web page? I have been trying to find out a suitable way to do this but it never ends up correct in the end. Thanks! bryonhost1 12-12-2004, 09:44 PM What kind of audio? Real has servers...I took a look at that once..Mp3's are almost impossible to stream...I can tell you that. I've got something like that on one of my accounts...let me go check. Bryon matt2kjones 12-12-2004, 09:54 PM depends what type of streaming you want to use. you can stream mp3 files for many different media players including winamp, windows media, realone (real player) and others by creating playlist files containing the location of the mp3 files on the server. This type of streaming is on demand so when the user clicks the link, it will always start at the beginning of the playlist, and work its way to the end. It will also stream the MP3 at the bit rate the mp3 is encoded in. If you want to stream content live, eg, radio style, then you will need to use streaming servers to do this. Shoutcast is one type of streaming server which can be found at http://www.shoutcast.com and there are also other tools there which you can use in conjunction with shoutcast to do live streaming. Shoutcast streaming servers work in both windows and unix enviroments. bryonhost1 12-12-2004, 10:48 PM Well..I'll be the first to admit I'm wrong once or twice..:) It was a long time ago...and at the time...the only way to pull it off was to download via http..no streaming. I checked..even my $1.95/month user account has streaming video and music support. Three out of six of my primary reseller accounts have support for it as well. I'll have more time tomorrow to check it out. Bryon I remember when computers had 4k RAM...cassette tape drives.. tuwebfacil 12-12-2004, 11:36 PM Is there a way to rest restrict the quallity of a stream using shoutcast? I wan to sell plans like this: 20 listeners, 48k quallity 40 listeners, 64k quallity and something like this. And if there panel who my customer can login an see stats, information and everything else. thanks for the help. matt2kjones 12-13-2004, 12:11 AM shoutcast is split up into two sections.... the actual shoutcast server, and the source..... the source is the software used to read the data from the mp3 file, re encode it to the desired bit rate, then send a live stream to the shoutcast server. The shoutcast server then streams this out to the users connected to it. The only way to restrict the bit rate of a stream is by setting it in the configuration of the source..... or if your not hosting the source, only the shoutcast server itself, then you cant control the bit rate..... you basically have to agree with them a bit rate they use, then monitor the server to make sure they dont stream at a higher rate. You can, however set the maximum amount of users, etc, that can connect to the shoutcast server. In the shoutcast server coniguration file you can set a password for the shoutcast server. Users can then login to the shoutcast server admin panel to check statistics of their stream, for example, current track, amount of users connected, ban / unban users from the stream, disconnect the source, etc. Shoutcast also hosts an XML file on its server, which can be read by scripts. You could use this to monitor the bit rate that users are streaming at.... for example, you could make a script which reads the XML file from the server once every 5 minutes.... the XML file will contain the current bit rate of the stream. if it is over what its meant to be, you could have the script kill the server PID. software to do this is pretty easy to make. and there might already be something like this out there for shoutcast, check their forums at www.shoutcast.com for such scripts. hope this helps tuwebfacil 12-13-2004, 12:24 AM thanks, This help so much! One more question :) Is there a software who can control the bit rate? and we can use to sell plans like the one I show you? thanks again. matt2kjones 12-13-2004, 12:37 AM In the shoutcast server configuration there is an option to set how many users can connect to a server.... so yes, you can control how many connections at once can be made. But the bit rate depends upon how you go about offering the service...... most shoutcasts hosts leave the shoutcast open for incomming source connections. This way, your customer will create a conenction from their system (where to music is stored) to your shoutcast server. Your shoutcast server will then stream it out to the users. If you customer wants to stream at 48k/sec, the connection from them to your server will use a constant 48k/sec..... however many users are listening..... but if there are 10 users listening, then the bandwidth used from your server to your listeners would be 480k/sec. this is kilo bits per second. the bit rate is set on the source.... since you wont be hosting the source, you cannot control the bit rate, only the maximum amount of users. However, their is probably a bit of software you could put between the source, and the shoutcast server, to regulate the bit rate down to a rate set by you..... I havent really looked into this. Shoutcast hosts i have used in the past have pretty much setup the server, setup the maximum users, then i have set my source streaming to the server. If i wanted to i could stream at a higher bit rate than what i was paying for, BUT, i would then be braking their terms of service, and if they cought me, would probably disconnect me. It would be easy to code a script to connect to all the shoutcast servers you host, whioch checks the bit rate the users are streaming at, and if it is above the level they should be streaming at, it could be setup to either kill the PID of their shoutcast server, or send you and email. Matt. tuwebfacil 12-13-2004, 12:40 AM thanks men! you really help with this post ;) dubrie 12-13-2004, 12:43 AM Wow, thanks for all the info! So Matt2k -- You are basically saying if I create a winamp playlist and set it up so it links to its location on my server, it will automatically stream? matt2kjones 12-13-2004, 01:00 AM Yes, that is exactly how you create on demand media.... Let me give you an example of a winamp .pls playlist file (just incase your not familiar how it works) [playlist] File1=http://example.com/mp3s/track1.mp3 Title1=User Friendly Name of track 1 File2=http://example.com/mp3s/track2.mp3 Title2=User Friendly name of track 2 File3=http://example.com/mp3s/track3.mp3 Title3=User Friendly name of track 3 NumberOfEntries=3 Version=2 .pls winamp playlist files alwats start with [playlist] title1=, title2= etc, are not required, they are optional. Data from the track will be used if titles are not provided in the playlist file. NumberOfEntries= should contain the number of tracks in the playlist. Version=2 tells winamp or other players which support .pls what version of the playlist they are using. Its been at Version 2 for a long time now. tuwebfacil 12-13-2004, 01:38 AM Thanks again men! you're great, very important info! dubrie 12-13-2004, 01:46 PM thanks again matt2k |