Streaming audio on the web is quite hard if you don’t have access to a special audio server. Here is an easy way to stream audio via ordinary http:
- Create a simple text stub file
The stub file contains the absolute URL to the location of the audio file on the HTTP server, e.g. http://mysite.com/audio/song.mp3
Save the file with the extension .m3u, e.g. song.m3u - Link to the stub file in the HTML
For example, <a href=”./audio/song.m3u”>This is My Song</a> - Playlist
You could include the URLs for a playlist in the stub file, each absolute URL to a different audio file on a new line. Audio files will be played one after the other.
Listen to this: As the Hart Pants, the opening chorus from Mendelssohn's Psalm 42.
So what happens?
When the user clicks the link on the web page, the browser downloads the entire file, as usual. But in this case, it’s just the .m3u file – which is just a few bytes and downloads lightning fast.
Next, the browser launches the MP3 player application, and hands it the file.
The MP3 player gets the file. It detects (by looking in it) that this isn’t an actual audio file, but a stub file.
The player then by itself opens a Network Connection, and starts downloading the actual .mp3 file, playing it as it is being downloaded! This downloading across-the-net is done completely by the player, and does not go through the browser at all.
How to do a simple edit of AIFF audio files with GarageBand (Mac)
- Launch GarageBand, click New Project, name it, select folder to save it in, click Create. The project is saved as a .band file.
- Find the .aiff audio file you want to edit in Finder, and drag it onto the workspace (close the wee piano dialog box that opens by default). The stereo sound track appears as a yellow bar across the time line.
- Use the controls at the bottom of the window to play the track. Note the red line showing point of play. You can stop play and move the red line manually (grab the triangle at the top of the line) to position it where you want it, for example to cut the track. Use Edit/Split to cut, then select either side of the split (by clicking it once) and press Delete to discard that section.
- Create a fade-out effect by using the Master Volume control (select Track/Show Master Track). Find the point in the track where the fade should start. Click once on the 0 dB line (note purple dot appears). Click once where the fade should end. Drag the second purple dot down as far as it will go. This will create a linear fade. Click further points in between and drag the dots down in whatever shape you want the fade to adopt. The dots can also be dragged left and right if you did not get it right the first time.
- Listen until you are happy with the effect, then split and cut the tail end off the track.
- Save!
Convert AIFF to MP3
- Send the track to iTunes: From the open GarageBand project, click Share/Send Song to iTunes
- Launch iTunes and change the import settings to the MP3 encoder:
Go to iTunes/Preferences/General and click Import Settings
Import using: MP3 Encoder
Setting: select the bit rate required (higher quality means larger file size; click the Custom option to select lower bit rates; even down to 64 kbps sounds OK on the web) - Find the track in iTunes – it will appear in the UserName Playlist (this is still a .aif file)
- Edit the file metadata: Control/Click on the file, select Get Info/Info and edit the song title, name of album, artist, composer, etc.
- Select the track (or multiple tracks) in the iTunes playlist that need to be converted to MP3 and Control/Click and select Create MP3 Version.
- The .mp3 file(s) will be saved to the /Music / iTunes / iTunes Music / UserName / UserName’s Album / directory.
- Remember to restore the iTunes import settings to AAC Encoder at High Quality (for importing music CDs).
References
Thank you to these sources for helping me figure this out.
http://www.petethomas.co.uk/web-streaming.html
http://www.lysator.liu.se/~zap/tutorial/ra.html
http://www.petethomas.co.uk/web-embedding.html – also discusses a Javascript method, and the embed/object method
http://www.interfluence.com/tutorials/audio.htm