Streaming Audio Presentation


Now that your streaming audio is ready to go, make sure it has the correct media attributes and is easy for listeners to access from your Web site. This section covers changing on-demand file attributes and creating and using metafiles to link to your stream. It also covers the importance of MIME types.

Changing Your On-Demand File Attributes

It's possible to change the name and any of the other attributes of your on-demand file without completely re-encoding the file. This can be a huge time saver if you realize you've misspelled the author's name or need to add your Web site's URL to a number of previously encoded files.

The tutorials that follow only cover changing your files' media attributes. For more complete information on the tools used in these sections, see the appropriate chapter for the format of your choice in Part II of this book.

Changing RealMedia On-Demand File Attributes

Both the RealProducer Basic and Plus allow you to edit the media attributes (clip information) for on-demand RealMedia files. The RealProducer Plus also allows you to edit other aspects of your on-demand file, such as start and stop times. As a result, Basic and Plus users have slightly different interfaces. The process works the same for both Windows and Macintosh users.

STEP-BY-STEP: Using RealProducer to Change RealMedia On-Demand File Attributes

  1. Launch RealProducer.

  2. Open the file you want to edit in the RealMedia editor.

    • RealProducer Basic Select File, Edit RealMedia File.

    • RealProducer Plus Select File, Edit RealMedia File, which opens the RealMedia Editor. Select File, Open RealMedia File (Windows: Ctrl+O, Macintosh: graphics/01icon05.gif+O), and click the Clip Info button to access the window to change the media attributes.

  3. Edit your attributes as desired.

  4. Save your edited RealMedia file to a new filename so that you can test your new file before overwriting the original.

    • RealProducer Basic Click the Save button.

    • RealProducer Plus Click OK and then select File, Save RealMedia File As.

After you've verified your new files, you may want to remove the pre-edited version of your files to avoid future confusion.

Changing Windows Media On-Demand File Attributes

The Windows Media Encoder can be used to change your on-demand Windows Media file's media attributes on the Windows platform. Certain third-party tools, such as Discreet's Cleaner 5, offer this feature on the Macintosh.

STEP-BY-STEP: Using Windows Media Encoder to Change Windows Media On-Demand File Attributes

  1. Launch Windows Media Encoder and select Convert from an Existing File from the New Session Wizard.

  2. In the Wizard, select your previously encoded Windows Media file as your input and enter a new filename for the output.

  3. Most importantly, select the identical encoding parameters that were used to author this file. If you don't choose the identical encoding parameters, the encoded file will be re-encoded. Don't re-encode an already encoded file as it results in additional loss of audio fidelity.

  4. Click OK, and the Windows Media Encoder creates a new file with your new attribute/name settings.

After you've verified your new files, you may want to remove the pre-edited version of your files to avoid future confusion.

Changing QuickTime On-Demand File Attributes

QuickTime Pro allows you to edit the media attributes (clip information) for QuickTime encoded files. The process works the same for both Windows and Macintosh users.

STEP-BY-STEP: Using QuickTime Pro to Change QuickTime On-Demand File Attributes

  1. Launch QuickTime Pro and open your previously encoded file by selecting File, Open Movie (Windows: Ctrl+O, Macintosh: graphics/01icon05.gif+O).

  2. Select Movie, Get Movie Properties (Macintosh: graphics/01icon05.gif+J, Windows: Ctrl+J).

  3. Make changes to your attributes (called annotations by QuickTime) and click OK.

  4. Select File, Save As to save it to a new file. You can also select File, Save (Windows: Ctrl+S, Macintosh: graphics/01icon05.gif+S) to overwrite the file with your changes.

After you've verified your new files, you may want to remove any pre-edited versions of your files to avoid future confusion.

Changing MP3 On-Demand File Attributes

Due to MP3's popularity, there are many tools to update the ID3 tag information in your on-demand MP3 files. This Step-by-Step uses Winamp for Windows and iTunes for Macintosh. Doing an online search for ID3 provides you with many software options, including shareware tools that can save time when you need to update several files.

STEP-BY-STEP: Using Winamp to Change MP3 On-Demand File Attributes

graphics/01icon04.gif
  1. Launch Winamp on your Windows computer and, if necessary, press Alt+E to display the Playlist window.

  2. Open (Ctrl+O) your previously encoded MP3 file.

  3. Right-click on the song title in the Playlist window and select File info (Alt+3) from the pop-up menu. A new MPEG file info box + ID3 tag editor window pops up.

  4. Edit your ID3 tag information and click Update.

STEP-BY-STEP: Using iTunes to Change MP3 On-Demand File Attributes

graphics/01icon01.gif
  1. Launch iTunes and (if necessary) select File, Show iTunes Window (graphics/01icon05.gif+1) to display the main playlist window.

  2. Either open a new file with File, Add to Library or select an existing file by locating it in the playlist window.

  3. Click on the song's title in the playlist window and choose File, Get Info (graphics/01icon05.gif+I). A Song Information window pops up.

  4. Click the Tags tab in the Song Information dialog box, update your song information, and click OK.

Metafiles: Linking to Your Stream from a Web Page

Metafiles are text files containing pointers to a live or on-demand stream and not the encoded stream itself. Originally designed to be a simple way for Web browsers to hand off multimedia streaming content to an appropriate player application, metafiles now can include other kinds of instructions. Several encoding tools offer options to automatically generate metafiles during the encoding process. Whether you use these tools to automatically generate metafiles (advanced users can write their own scripts for this) or create the metafiles by hand depends on your individual authoring environment.

Without a metafile Web browsers will, by default, download the entire encoded file before passing it to the player. This slow and cumbersome process completely misses the point of streaming.

Any word processor program can be used to create a metafile. Metafiles are only lines of text saved in a regular text file. The minimum information necessary is the full URL to the live or on-demand stream on your streaming server. A metafile typically resides on a Web server, and the stream the metafile points to resides on a streaming server.

In this section, you'll create metafiles in each format, suitable for uploading and linking to from your Web site. See the Appendix for a list of online resources to create and use metafiles.

Linking to Your RealMedia Stream

RealMedia has several types of metafiles from which to choose. .ram and .rpm files are the oldest and still most commonly used. Although their contents are the same as .ram, .rpm files cause the browser to use an internal RealMedia plug-in to play the stream inside of the Web page. .ram files are used to have the browser launch an external player (on the same computer) for playback. In this section, you'll create .ram files. (To create .rpm files, see Chapter 13, "Advanced Presentation.")

NOTE

Synchronized Multimedia Integration Language (SMIL) files represent a World Wide Web Consortium (W3C) standard markup language that provides much more control over how and when streaming files play. RealNetworks pioneered the use of this standard, commonly used when integrating multiple clips of different media types and playing them together as one presentation (see Chapter 13). Advanced users might want to research SMIL technology further. SMIL files are easy to identify by their .smi or .smil suffixes.


A .ram file, in its simplest form, is merely a text file that contains the URL to your streaming audio. That URL can point to a real-time streaming server (rtsp://) or to an HTTP/Progressive streaming Web server (http://). For example, to create a metafile for linking to the song mysong.rm in the samples directory of the real-time RealServer named streaming.fezguys.com, you would create an ordinary text file named mysong.ram that contains the following text:

 rtsp://streaming.fezguys.com/samples/mysong.rm 

You would then place it on the Web server and link to it like any other Web page. For example, you could place the following:

 Would you like to <A HREF="mysong.ram">hear a song?</A> 

on the appropriate page of the Web site. In this example, the phrase hear a song (contained within the sentence) becomes the link. When listeners click on this link, their browser retrieves the metafile mysong.ram from your Web server and then launches RealPlayer, passing the metafile file to the player. RealPlayer reads the URL and any other information from within the metafile and connects to the RealServer to play the actual audio stream.

Other text commands such as starting and stopping times and certain (limited) file attributes can be included along with the URL in a .ram (or .rpm) file. These other commands are expressed as:

 name="value" 

pairs and must be preceded by a ? (question mark) and separated from each other by an & (ampersand).

Imagine a scenario in which you have a single archived live event of ten bands, all part of the same on-demand streaming file. You want to allow listeners to be able to choose between the individual bands' performances rather than force them to search the entire file for a particular band. To do this, you need to create ten separate metafiles (one for each band). By using metafiles, you avoid having to open the giant four-hour on-demand file in a waveform editor and perform numerous editing operations or, even worse, re-encode from the master file into ten separate encoded files. Instead, you simply create metafiles with the correct start and stop times and names for each band's performance.

In this example, the four-hour 10-band stream's URL is rtsp://streaming.fezguys.com/archive/alltenbands.rm.

The metafile should point to only the first band, so the start and stop times of the first band's 25-minute performance are located and the metafile is created as follows:

 rtsp://streaming.fezguys.com/archive/alltenbands.rm?start="1:00"&stop="2  6:00"&title="Guster Live"&author="Guster". 

The RealPlayer also supports including more than one URL in each metafile. You could enter multiple URLs (each on their own line in the metafile), thereby creating a playlist. Using the previous scenario, you could create a single metafile with all ten bands' URLs, including start and stop time, title, and author overrides. Listeners will be able to scroll through each section, or clip, from within their RealPlayer.

After creating your .ram metafile, simply upload it to your Web server with your FTP program and link to it from your Web page.

RealServer has a tool called ramgen that generates .ram files automatically. If you don't need to change the attributes contained in your streams, you can use this to save yourself the trouble of individually creating and uploading metafiles.

NOTE

Live events with high attendance typically do not use ramgen because it places an additional load on RealServer.


Ramgen requires the RealServer to be configured to handle HTTP requests. For that reason, you need to know on which port the RealServer is configured to be listening to those HTTP requests. RealServer's installation default port is 8080.

An example of using ramgen to generate a metafile for mysong.rm (residing in the Samples directory of streaming.fezguys.com) is as follows:

 Want to <A HREF="http://streaming.fezguys.com:8080  /ramgen/samples/mysong.rm">hear a song?</A> 

This command links directly to ramgen, which outputs the same text content that a metafile would. See your RealServer documentation for more detailed information on using ramgen.

Linking to Your Windows Media Stream

Windows Media has several types of metafiles from which to choose. .asx is an older type, and newer types include .wax (for audio only) and .wvx (for video).

The .asx metafile is still the most commonly used type for linking to Windows Media streams. This is because .wax doesn't always work seamlessly across different (especially older) operating systems and browsers. This book sticks to using the .asx type of Windows Media metafile.

Each .asx file is a text file containing the URL (as well as other elements that define a file as being a Windows Media metafile) to your streaming audio. The URL in that metafile points to a real-time Windows Media streaming server (mms://) or an HTTP/Progressive streaming Web server (http://). For example, to create a metafile for linking to the song mysong.wma in the Samples directory on the Windows Media server named streaming.fezguys.com,you would create a file named mysong.asx that contained the following text:

 <ASX version = "3.0">  <Entry>    <Ref href="mms://streaming.fezguys.com/samples/mysong.wma" />  </Entry>  </ASX> 

After the metafile is created, it is placed on a Web server and incorporated as a link, like any other Web page. For example, you could place this:

 Would you like to <A HREF="mysong.asx">hear a song?</A> 

on the appropriate page of the Web site. In this example, the phrase hear a song (contained within the sentence) becomes the link. When listeners click on this link, their browser retrieves the metafile mysong.asx from the Web server. The browser then launches the Windows Media player and hands the metafile file to it. The player reads the URL and any other information in the metafile and connects to the streaming server to play the actual audio stream. Other commands can be included in .asx metafiles, such as author, title, copyright, start time, and duration.

Imagine the same scenario (as in the section "Linking to Your RealMedia Stream") in which you have a single archived live event of ten bands, all part of the same on-demand streaming file. You want listeners to be able to choose between the individual band's performances rather than force them to search the entire file for a particular band. To do this, you'll create ten separate metafiles one for each band. By using metafiles, you avoid opening the giant four-hour on-demand file in a waveform editor and performing numerous edits or, even worse, re-encoding from the master file into ten separate encoded files. Instead, you'll simply create metafiles with the correct start and stop times and names for each band's performance.

If the four-hour 10-band stream's URL is this:

 mms://streaming.fezguys.com/archive/alltenbands.wma 

and you want to use a metafile to point to only the first band, you would locate the start time and duration of the first band's 25-minute performance and create your metafile as follows:

 <ASX version = "3.0">  <Entry>    <TITLE>Guster Live</TITLE>    <AUTHOR>Guster Live</AUTHOR>    <STARTTIME VALUE="1:00" />    <DURATION VALUE="25:00" />    <Ref href="mms://streaming.fezguys.com/archive/alltenbands.wma" />  </Entry>  </ASX> 

The Windows Media Player also supports including more than one URL in this metafile by allowing multiple <Entry> (including start time, duration, title and author overrides) sections, thereby creating a playlist. To do this, it's a simple matter of replacing the relevant information within the text of the URL. When including more than one <Entry>, you might want to include a <TITLE>, <AUTHOR>, and <COPYRIGHT> for the presentation as a whole so that the information displayed on the Web page makes more sense. Here's how the metafile could look:

 <ASX version = "3.0">  <TITLE>Ten Live Bands</TITLE>  <AUTHOR>Ten Different Bands</AUTHOR>  <COPYRIGHT>2002 FezGuysLiveCo</COPYRIGHT>  <Entry>    <TITLE>Guster Live</TITLE>    <AUTHOR>Guster</AUTHOR>    <STARTTIME VALUE="1:00" />    <DURATION VALUE="25:00" />    <Ref href="mms://streaming.fezguys.com/archive/alltenbands.wma" />  </Entry>  <Entry>    <TITLE>Dandeline Live</TITLE>    <AUTHOR>Dandeline</AUTHOR>    <STARTTIME VALUE="27:00" />    <DURATION VALUE="25:00" />    <Ref href="mms://streaming.fezguys.com/archive/alltenbands.wma" />  </Entry>  </ASX> 

Keep adding the appropriate information for all ten bands.

After creating an .asx metafile, simply upload it to your Web server with your FTP program and link to it from your Web page.

Linking to Your QuickTime Stream

QuickTime doesn't use metafiles in its streaming system. Instead, you can create a separate QuickTime .mov file that acts like a metafile.

If you link directly to your QuickTime on-demand files from your Web page, a listener's browser will, by default, attempt to open the file using the browser's plug-in. To avoid having this happen, create a small "poster movie" file to link to the actual URL of your QuickTime on-demand streaming file, and then embed this poster movie into your Web page. A poster movie can be an image of any size, which makes it easy to incorporate into the design of your Web site. When clicked, the poster movie launches an external player. Embedding a poster movie simply allows you to access the QuickTime plug-in necessary to launch an external player for a QuickTime stream.

It's not necessary to use the <EMBED> tag (see Chapter 13, "Advanced Presentation," for additional information about this process) when linking to Windows Media, RealMedia, or MP3 metafiles. QuickTime, however, requires some embedding. Although the process might seem confusing or overly complex at times, stick with it. We promise it'll all make sense.

To make a QuickTime poster movie and link it to a QuickTime stream, first choose an image. Anything will do, but you might as well use something that is relevant to the content of the audio. You could also create a simple Play button. The image you use must be saved in a file format that QuickTime Player Pro can recognize and import. All common formats (JPEG, GIF, and so on) are supported.

Launch QuickTime Player Pro on your authoring computer. Select File, Import, locate your image, and click Convert. Next, choose File, Export (Windows: Ctrl+E, Macintosh: graphics/01icon05.gif+E) and then Export to QuickTime Movie, making sure your exported file name ends in .mov. Click Options, and in the Movie Settings pop-up window, make sure the video option is checked so that your image will be included. Click Settings under the video check box and choose a compression type for your image. (Photo-JPEG is a safe bet.) Choose a Quality setting. (Medium or above will do, or just match the image quality settings for your Web page.) Ignore the Motion setting because you're working with a still image, close Movie Settings, and, making sure your file ends in .mov, click Save. Upload your saved poster movie to your Web server.

You can use the following HTML sample to link the poster movie to a QuickTime on-demand streaming file for use by any browser that supports Netscape's plug-in architecture. You will embed poster.mov and link it to sample.mov in the samples folder on the streaming server streaming.fezguys.com.

 <EMBED src="/books/2/718/1/html/2/poster.mov"    WIDTH="160" HEIGHT="120"    HREF="rtsp://streaming.fezguys.com/samples/sample.mov"    TARGET="quicktimeplayer" CONTROLLER="false"    PLUGINSPAGE="http://www.apple.com/quicktime/download"></EMBED> 

Because support for Netscape plug-in architecture has been removed from MSIE5.5 and later (Windows only), you will have to use Microsoft's ActiveX to ensure that the QuickTime poster movie will do its job for listeners who are using MSIE 5 on Windows. You do this by including the ActiveX control <OBJECT> tag around the Netscape plug-in <EMBED> tag in your HTML.

The commands in the previous code sample, when wrapped within the ActiveX <OBJECT> tags, now look like this:

 <OBJECT CLASS    WIDTH="160" HEIGHT="120"    CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">    <PARAM NAME="SRC" VALUE="poster.mov">    <PARAM NAME="CONTROLLER" VALUE="false">    <PARAM NAME="TARGET" VALUE="quicktimeplayer">    <PARAM NAME="HREF" VALUE="rtsp://streaming.fezguys.com/samples/sample1.mov">  <EMBED      src="/books/2/718/1/html/2/poster.mov"      HREF="rtsp://streaming.fezguys.com/samples/sample1.mov"      WIDTH="160" height="120"      CONTROLLER="false"      TARGET="quicktimeplayer">  </EMBED>  </OBJECT> 

After incorporating these commands into your Web page listeners will be able to click on this poster image to start playing the on-demand file in their external QuickTime player.

Linking to Your MP3 Stream

MP3 streams have a few types of metafiles from which to choose. The most commonly used .pls metafile can be a URL (or a list of URLs), but it can also specify how many streams to play and the location and length of each. An older form of MP3 metafile (.m3u) is simply a URL (or a list of URLs) and doesn't allow additional information. This section uses the .pls MP3 metafile type.

A .pls metafile is a text file that contains the URL, length, and title of your MP3 live or on-demand stream(s). The URL in the .pls metafile points to an MP3 streaming server (such as SHOUTcast) or a standard Web server (both of which are HTTP/Progressive streaming and begin in http://).

To create a metafile for linking to the song mysong.mp3 in the samples directory on the SHOUTcast server named streaming.fezguys.com, you will create a file named mysong.pls that contains this text:

 [Playlist]  Version=2  numberofentries=1  File1=http://streaming.fezguys.com/samples/mysong.mp3  Title1=My Sample Song  Length1=3:42 

If you're linking to a live stream, set the Length value to 1.

The Version tag lets the MP3 player know that this is a later version of the .pls metafile that includes the Title and Length tags. The Title and Length tags are only used for streams that are not playing yet. As each stream completes and the MP3 player opens the next URL, the player attempts to extract information from the MP3 stream (if any is present). If you don't care about providing the Title and Length for all streams in your playlist, you can omit them and the Version=2 entry.

After creating the mysong.pls metafile, place it on your Web server and link to it like any other Web page. For example, in this text:

 Would you like to <A HREF="mysong.pls">hear a song?</A> 

the phrase hear a song becomes the link. When listeners click this link, their browser retrieves the metafile mysong.pls from your Web server. The browser then launches an external MP3 player and hands the metafile file to it. The player reads the URL in the metafile, connects to your server, and plays the actual audio stream.

As you can guess by this example, you can include more than one song in a .pls file. For example, perhaps you have a language Web site that has five files containing the phrase Thank You, with each file in a different language. Instead of creating five different metafiles, you can create one metafile with the appropriate name for each language.

If the URL to the folder that contains the five on-demand files is this:

 http://streaming.fezguys.com/archive/thankyou/ 

and each version is named by the language it includes, you could include all five as follows:

 [Playlist]  numberofentries=5  File1=http://streaming.fezguys.com/archive/thankyou/english.mp3  Title1=Thank You (English)  Length1=0:20  File2=http://streaming.fezguys.com/archive/thankyou/spanish.mp3  Title2=Thank You (Spanish)  Length2=0:20  File3=http://streaming.fezguys.com/archive/thankyou/russian.mp3  Title3=Thank You (Russian)  Length3=0:20  File4=http://streaming.fezguys.com/archive/thankyou/latvian.mp3  Title4=Thank You (Latvian)  Length4=0:20  File5=http://streaming.fezguys.com/archive/thankyou/japanese.mp3  Title5=Thank You (Japanese)  Length5=0:20  Version=2 

After completing the .pls metafile, upload it to your Web server with your FTP program.

Configuring Your Web Server's MIME Types

A Multipurpose Internet Mail Extensions (MIME) type is a way to define the contents of a file. Many programs, including Web servers, use the suffix of a filename to determine the file's MIME type. For example, when you tell your browser to open the page www.fezguys.com/audio/sample.pls, the Web server that handles www.fezguys.com looks up a .pls file's MIME type in its configuration. The Web server then returns the contents of sample.pls marked as the applicable MIME type. Each Web server has its own configuration format. If you're unsure of how to change the MIME settings, check the Web server's documentation. An improperly configured Web browser might prevent people from listening to the audio you've spent so much time preparing, so do remember to check this.

NOTE

If you test your metafiles on a Windows computer, you might not notice problems with incorrect MIME type settings. This is because Windows does its own local MIME type check based on the filename after it has been downloaded. As a result, Macintosh users could have problems with your metafiles, and you might not realize it. It's always recommended that you double-check your MIME type settings on your Web server.


Included next is a listing of the correct MIME types and file suffix descriptions for metafiles used in the Step-by-Steps in this chapter. Verify that the Web server that is hosting your metafiles is properly configured for each of these MIME types. Each format also has other, less-common MIME types of which it makes use. Make sure that the MIME types for any other metafiles you decide to use are included in your Web server's configuration.

  • MP3 metafile The file suffix is .pls, and the MIME type is audio/x-pls.

  • RealMedia metafile The file suffix is .ram or .rpm, and the MIME type is audio/x-pn-realaudio.

  • Windows Media metafile The file suffix is .asx, and the MIME type is video/x-ms-asf.

  • QuickTime metafile The file suffix is .mov, and the MIME type is video/quicktime.



Streaming Audio. The FezGuys' Guide
Streaming Audio: The FezGuys Guide
ISBN: B000H2N1T8
EAN: N/A
Year: 2001
Pages: 119

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net