I want to stream music from my website. The file format is .rm. People say that one need a Helix Server or other media server to stream. I have found a solution to this problem as well. I read an article about streaming music. It tells that if the size of the media file is small and the byte rate of the media file is lower than that of the user internet connections byte rate, the file get streamed automatically from HTTP
server.
In theory, any file is "streamed" by a web server that is, sent back to the client in small pieces. What makes
media files special is that a media player can start playing the file even before it receives the full file. However, supposing the media player downloads one second of music, and plays it, and the data for the next second has not yet been downloaded, it will stop immediately. You will have to click Play again. However, if the bit rate of the media file is less than the bit rate of the connection, the player will always be able to download faster than play, and so, while there may be delays in playing the media, it won't stop.
I have uploaded couple of files on the server and they are working. But in my endeavor of making a contemporary online music website I am facing many problems which are as follows:-
I am using object and embed tag to play music in WebPages. I have created a RAM file which contains the links of the media files i.e. RM files. The RAM file is embedded to the web page e.g. <embed src=”http://server/ramfile.ram “>. Up to this point everything is under control. Now I want to let my users choose multiple songs. To do that, I used check box to select more that one song. I used query strings to send the links or id of the selected songs and retrieved the urls on the page where the songs would be played. Here the problem arises. How can I add multiple url to embed tag.
I found out a solution but it did not work. My idea was to create a RAM file (Many of you guys may already know about it yet I would like to explain the phenomenon. One can create a RAM file which may contain more than one media file links. For example, aramfile.ram may contain both http://server/a.rm and http://server/b.rm. If such a RAM file is embedded to a web page multiple songs can be played in a random manner) dynamically which would contain the list of links we received from query string. But with PHP, one cannot create a file on web server nor can open a file with write option. According to me it was the best possible solution but it is not feasible. I know that many professional personal employ this method. How they do it is mystery to me.
Then I began my search to find a way out. Fortunate I found out a way. Answer to my problem was HTTP HEADER. I would like to share what I understand about HTTP HEADER before I proceed.
Using headers server and browser communicate. Server sends headers before sending any other data.
Headers can contain many types of information and instructions that the server and browser use to help each other know what to do next.
Further PHP can be used to manipulate headers to get desired output. Using the following the codes one can create a ram file.
header("Cache-control: public");
header("Content-Type: audio/x-pn-realaudio ram;");
header("Content-Disposition: filename=a.ram");
echo $fres;
exit();
It did work. But in external player. I could not play the song inside the web page. So, friends I would be very grateful if some one helps me out …..

