Sami's Site: CSB - Trellix Support and Tests
  up  
Streaming Audio   ·    FORUM

Streaming Audio
THIS IS AN OLD TUTORIAL AND HAS NOT BEEN UPDATED RECENTLY. THERE ARE MUCH BETTER INSTRUCTIONS ONLINE.  

Trellix and CSB come with a way to insert audio file and upload it to your website.  It works for MIDI, MP3, WAV and other sounds too.  You can play the sound in the background (hiding or showing the player), or just have a link to the sound.

BUT... that is NOT the fastest way to load your larger mp3 sounds. Consider Streaming audio.  
You can hear MY test on this page.  To hear this sound you must have a player that reads playlists.  Most computers have players like a Windows Media Player, WinAmp, Real Player, etc.  If your visitor is on an old system that does not have one of them, you could provide links for them to download programs.

Even streamed media may need to reconnect or re-buffer due to 2 main reasons:
the media file is encoded at a bit rate to high for the viewer’s connection (set to a speed compatible with dsl, but visitor is on dialup), or
internet congestion either caused by the viewers ISP or the net itself (consider that Sunday evenings in the USA are a prime time for this to happen).



EASY WAY TO IMPLEMENT A STREAMING AUDIO FILE USING M3U PLAYLIST FILE:

Note: This tutorial does not cover the creation of an MP3 file.  It assumes you already have one ready to post to your site. (My choice for this page: short music clip of "Shades of Gray" performed by the Monkees March 1967 - 109 seconds  copyright info)  

This technique requires 2 files:   a playlist file, and a sound file (mp3)

1. Using FTP Software , upload your MP3 file to a folder on your website.  If you plan on having several mp3 files for your website, you can set up a folder specifically to hold them (I created a folder called sounds to hold my wav and mp3 files).

2. Test your URL for the mp3 file that you want to use to make sure you have it correct.  (My site address is http://www.samisite.com and the sounds are in the sound folder.  So to get to the sound I want to use on this page the address is http://www.samisite.com/sound/thefilename.mp3)

3. Make a playlist file. Open NotePad (installed on all Windows machines), or any other text program.  Paste the URL to your mp3 song into the text file then save the file as "filename.m3u".   
File Name: shades.m3u  and the only thing in the file is this address to the sound I want to play:

http://www.samisite.com/sound/cropShadesofGrayMonkees.mp3

PROBLEM - STRONG WARNING:  If your visitor saves a m3u file to their computer they get the URL addresses of the mp3 songs, not the songs themselves.  That's fine. But, they could use the m3u file with their media player to link to your music files on the web, drawing from your website bandwidth allotment, even if they are not visiting your website!  Web hosts only allow you a certain amount of transfer so you must guard it.

SIMPLE FIX: If you use relative linking, you can keep people from accidentally accessing your music files from their desktop.  In order to access the sound file stored on your website, they must manually change the m3u file before using it!  Those folks can be identified and stopped from doing so.

This is an absolute link: http://www.samisite.com/sound/cropShadesofGrayMonkees.mp3
It has the full website URL included.  Using it in your m3u file could cause your visitor to play your music without visiting your website.

Change it to a relative link before you upload the m3u file to your website.
Remove your website domain from the link: http://www.samisite.com/sound/cropShadesofGrayMonkees.mp3
so the relative link becomes: /sound/cropShadesofGrayMonkees.mp3
The / at the front tells the browser to go to the main directory of the website you are visiting.
sound is the directory stored in the main area of the site (yours could be different)
and the rest is the music/sound file name.

My final file: shades.m3u     and the only thing in the file is this address to the sound I want to play:

/sound/cropShadesofGrayMonkees.mp3

How this fix works:  If playing sound while visiting the website, the sound file can be played.  If playing from a desktop, the WEBSITE domain is missing so the media player can NOT connect to your website URL to play the file!
Try it yourself:  Right click this link and choose SAVE TARGET AS and you can download the m3u file to your computer desktop.  Once downloaded, you can double click the file to try to play it from your desktop.  Your media player will try to locate the music listed in the file, but will not be able to do it!

purple arrow purple arrow purple arrow   IMPORTANT:  BE CAREFUL HOW YOU TYPE YOUR FILE NAMES. No spaces, characters (other than dash - or underline _.  CaPS and LOwerCAsE do make a difference on MANY servers!!! myfile.mp3 and MyFile.mp3 is not the same file on some servers!  

4. Upload that m3u playlist file to your web-site using FTP software.  You can place your m3u files in the same folder as your sounds or you can make a separate folder for them.  (I just added my m3u playlist to the same sounds folder with my mp3 files).

5. Now in your webpage, insert a link to the m3u playlist file.  You can use a text or image link to the file. In CSB or Trellix, choose to link to URL. Or if you want to EMBED the sound so it begins when the page opens, just place one of these codes into your webpage with Insert HTML (webgem), linking to your m3u file.  Change the link address (shown in red) to your sound file of course.  That's it!   

This code allows your sound to immediately start to load (autostart) and allows your visitor the control to turn it off. The control will appear where you place the inserted HTML (usually at bottom of page). (This code was used on this page!)
<embed src="http://www.samisite.com/sound/shades.m3u" autostart="true" hidden="false">
This code allows your sound to immediately start to load (autostart) but does NOT allow your visitor the control to turn it off. Can be annoying on some sites.
<embed src="http://www.samisite.com/sound/shades.m3u" autostart="true" hidden="true">

purple arrow purple arrow purple arrow PLAYING MORE THAN ONE SOUND FILE ON A PAGE:      (updated May 20, 2007)
You can even place links more than one song or sound in the file so that when the first song is done playing, the second begins, etc.  By listing the URL address to each sound file on it's own line in the m3u file, your music player will play each one in turn.  When the first is done, the second begins until you have gone through the list.  
My multi-sound m3u playlist file only contains 2 lines of text:
/sound/cropShadesofGrayMonkees.mp3
flowersclip.mp3
Since both files are in the same folder, only the first one in the list would contain the folder information. Thereafter, only the name of the music file is necessary.  If you have music in different folders, you would need to identify the folder for EACH music clip.

Try it with this file: 2songs in the file   To play the songs, choose: OPEN file from Current location if you get that option.  (short music clip of "Shades of Gray" performed by the Monkees March 1967 - 109 seconds, followed by a clip of "Flowers are Red" from Harry Chapin's live album)
NOTE: The URLs to the music clips are real - do not link to any of them from your computer or website!    

LOOPING: If the visitor has their player set to LOOP music as it is played, the music/sound from your website will LOOP! That setting is controlled by the visitor not you when including music in your webpage this way.

purple arrow purple arrow purple arrow BEST SOLUTION... USE FLASH!
More sophisticated creation and insert of streaming sound:  MP3 Sound Stream  $40
I have not tried it but other CSB users report excellent results!
RELATED STREAMING MEDIA LINKS:

Windows Media Encoder 7.1   You Must change the SELECT A DOWNLOAD dropdown to Windows Media Encoder to access page to download this free program.   It will convert many audio and video file formats, including mp3 files. Many reasons for considering version 7.1 instead of the newer version 9:
this version of  7.1 also encodes version 8 files,
the media will play on older AND newer Windows Media players so is more compatible,
needs FAR LESS processor resources than version 9 (which is necessary for XP!),
when you use encoder version 9, the visitor must have the new 9 series media player to see the content

Of course, Real Producer (by Real Player) also has a free BASIC version that only works with realplayer 10 (not earlier versions so it limits how many people can hear your music) or full version for $200.  Note: Version 8.5 is still available for download and will convert videos and audio files like wav, mov and avi files but NOT mp3 files.

How to embed a VIDEO into your webpage.

The CSB/Trellix program inserts a "placeholder" image to remind you where the code is and give you a way to access the code for editing.  You CAN change that placeholder image!  Read more.

 
I own the albums these pieces came from and do not file share.  The music on this webpage is only a partial snippet of each of the songs noted, not the full piece as performed by the artist.  Lyrics and music are property and copyrighted by their owners and I respect that!  The posting of these snippets is not intended to infringe on the appropriate copyrights and the clips would be removed if requested.
Fair Use Notice: This page contains copyrighted material whose use has not been specifically authorized by the copyright owners. I believe that this not-for-profit use on the Web constitutes a 'fair use' of the copyrighted material as provided for in section 107 of the US Copyright Law. If you wish to use this copyrighted material for purposes of your own that go beyond 'fair use,' you must obtain permission from the copyright owner.