<p>For years, I've been investigating how to create music streams from my computer.  I've seen programs, but anything useful I've seen is Windows only (I use a Mac).</p>

<p>Eventually, I got interested in <em>how</em> streams work.  Is there any way I could create my <em>own</em> stream, possibly using socket functions in <code>PHP</code>?  Is there a <code>PHP</code> library for this?</p>

[{'answer_id': 45229, 'author': 'Espo', 'author_id': 2257, 'author_profile': 'https://Stackoverflow.com/users/2257', 'pm_score': 2, 'selected': False, 'text': '<p>Take a look at <a href="http://ampache.org/" rel="nofollow noreferrer">Ampache</a>. It is a Web-based Open Source Audio file manager. It is implemented with MySQL, and PHP. It allows you to view, edit, and play your audio files via the web.</p>\n'}, {'answer_id': 48765, 'author': 'pilif', 'author_id': 5083, 'author_profile': 'https://Stackoverflow.com/users/5083', 'pm_score': 1, 'selected': False, 'text': '<p>In the end it all boils down to the protocol you\'d want to use. Shoutcast IMHO is plain HTTP, so to <em>make</em> your own stream, you just output the streams content.</p>\n\n<p>To make an ogg based webradio work with my Sonos system, I have created a little transcoding wrapper around sox which is is actually written in PHP, so it may be helpful to you to serve as an example.</p>\n\n<p>You\'ll find it here: <a href="http://www.gnegg.ch/ogg2mp3/" rel="nofollow noreferrer">http://www.gnegg.ch/ogg2mp3/</a></p>\n\n<p>If you are after implementing your very own streaming protocol - maybe even UDP based, then, I\'m afraid, PHP may not be the right solution for the problem - at least not as long as it has its share of problems when used for long running processes (which 5.3 may bring some help for with its integrated garbage collection)</p>\n'}]
['https://Stackoverflow.com/questions/45166', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1615/']