How to Stream MP3

How to Stream MP3

To stream an mp3 file, upload your mp3 file to your public-html directory (or to a subdirectory of your public-html directory) preferably in MP3 format. OGG is also supported in Chrome and Firefox, but not in Safari and Internet Explorer.

Then use this code:

<audio controls>
<source src="http://yourwebsite.com/youraudio.mp3" type="audio/mpeg">
<source src="http://yourwebsite.com/youraudio.ogg" type="audio/ogg">
</audio>

For example:

  1. Create a subdirectory (e.g., media) in your public-html directory.
  2. Then, upload your mp3 file named (e.g., youraudio.mp3 into that directory. Be sure to upload The mp3 file in BINARY format.
  3. Finally, add the above code with the fully-qualified URL of your mp3 file (e.g.,http://yourdomainname.com/media/mysongfile.mp3).
  4. Then visit the page and start the playback.

If you are using WordPress, it can natively handle media files and streaming. Upload your media file and insert it into a post. It’s that easy.

In the case of mp3 media, the buffering is determined by the media player on the listener’s computer — it’s not a server-side function.

[REMINDER: The transmission, storage, or presentation of any information, data or material in violation of any United States Federal, State or local law is strictly prohibited under the terms and conditions of your hosting account. This includes copyrighted material used without permission.]