Click to return to the Windows Media Technologies home page    
Web Workshop  |  Streaming & Interactive Media  |  Windows Media Technologies

ASF ABCs


Updated February 4, 1999

Introduction

ASF is a file format that stores audio and video information and is specially designed to run over networks like the Internet. It is a highly flexible and compressed format that contains streaming audio, video, slide shows, and synchronized events. ASF enables content to be delivered to you as a continuous flow of data with little wait time before playback begins. This means that you no longer have to wait for your audio and video files to fully download before starting to view them. You simply launch the Windows® Media Player and begin. 

Get Windows Media Player

For example, you can spend more than 40 minutes to download an uncompressed AVI file that's 40 seconds long over a 28.8 Kbps modem, and that requires 1.5 Mbps in bandwidth to play it back. It would be virtually impossible to deliver training presentations that run approximately 20 minutes each segment. When that AVI file is compressed and converted to ASF, it begins playing after only a few seconds. The file can be of virtually unlimited length, and can run over Internet bandwidths.

Creating Files in ASF Format

If you already have audio or video on your site in a popular format, such as WAV or AVI, it's easy to convert it to ASF with Windows Media tools. Follow the steps below. If you don't have any digitized media on your site, you can easily record audio or video and convert it to ASF.

Recording audio is easy. Just use a microphone and sound editor, such as Sound Recorder provided with Windows (Start | Programs | Accessories | Entertainment | Sound Recorder), or another sound editor of your choice. Most laptops have built-in microphones, and popular sound cards have inputs for microphones. Recording video requires a video camera and a capture card. For details on these, see Video Capture CardsNon-MSDN Online link.

TopBack to top

Here are three ways to get started creating and hosting ASF content:

Converting Existing Digital Audio to ASF

  1. If you do not have Windows Media Player, download the player by clicking this graphic:

    Get Windows Media Player

  2. Install Windows Media Tools Non-MSDN Online link. To check if these tools are already installed, open the Windows Start menu. Under the Programs tab, you'll see the Windows Media Encoder in the Windows Media Services folder.
  3. Start the Windows Media Encoder. A welcome window will appear. Choose the second radio button on the list labeled "Template with I/O options." Click OK.
  4. Select the 28.8 audio presentation from the template window. Click Next.
  5. Click the bottom choice (AVI/WAV/MP3). Click Next.
  6. If you already have a WAV file, simply type in the file name. If you don't have a WAV file, you can create one with Sound Recorder, a small program that installs with Windows, or check out our sample.wav here. Type the path to your source. Click Next.
  7. Select the button labeled "To a local ASF file" and click Next.
  8. A filename prompt appears. Supply a filename for your ASF file in the text area labeled "filename." Note: If you do not have an ASF file, simply type in a name and one will be created for you. Click Next.
  9. If you choose to, you can type a description in the description field (optional). Click Finish.
  10. The main interface of the Windows Media Encoder will appear. Click the play symbol labeled "Start" to begin encoding.
  11. An ASF file should appear in the folder you designated. Click the file and you will hear your media.
  12. To place a link to your ASF file from your Web page, you will need to create an ASX file. An ASX file is a text-based metafile that provides a link between your page and the ASF file.
  13. Open your text editor. Copy and paste this code:
    <ASX version="3">
       <Entry>
          <ref HREF="path\file.asf"/>
       </Entry>
    </ASX>
    
  14. Save the file into the same folder as the ASF file. Change the path in the <REF HREF> tag so that it points to your file. The extension must be changed from .txt to .asx.
  15. Test this ASX file by clicking it. You should get the same response as in step #11.
  16. Add an <H REF> tag to your Web page that points to the ASX file.
    <a HREF="path\file.asx">
    Start Windows Media Presentation
    </a>
    

  17. Test your Web page by clicking your link to the ASX file.

TopBack to top

Converting Existing Digital Video to ASF

  1. If you do not have Windows Media Player, download the player by clicking this graphic:

    Get Windows Media Player

  2. Install Windows Media Tools. To check if these tools are already installed, open the Windows Start menu. Under the Programs tab, you'll see the Windows Media Encoder in the Windows Media Services folder.
  3. Start the Windows Media Encoder. A welcome window will appear. Choose the second radio button on the list labeled "Template with I/O options." Click OK.
  4. Select the 28.8 High Motion Video option from the template window. Click Next.
  5. If you already have an AVI (or other digital video format) file, simply type in the file name. If you don't have an AVI file, you can create one with a capture card and a video editing program, or download this sample.avi. Type the path to your source. Click Next.
  6. A filename prompt appears. Supply a filename for your ASF file in the text area labeled "filename." Note: If you do not have an ASF file, simply type in a name and one will be created for you. Click Next.
  7. If you choose to, you can type a description in the description field (optional). Click Finish.
  8. The main interface of the Windows Media Encoder will appear. Click the play symbol labeled "Start" to begin encoding.
  9. An ASF file should appear in the folder you designated. Click the file and you will see your media.
  10. To place a link to your ASF file from your Web page, you will need to create an ASX file. An ASX file is a text-based metafile that provides a link between your page and the ASF file.
  11. Open your text editor. Copy and paste this code:
    <ASX version="3">
       <Entry>
          <ref HREF="path\file.asf"/>
       </Entry>
    </ASX>
    
  12. Save the file into the same folder as the ASF file. Change the path in the <REF HREF> tag so that it points to your file. The extension must be changed from .txt to .asx.
  13. Test this ASX file by clicking it. You should get the same response as in step #9.
  14. Add an < A HREF> tag to your Web page that points to the ASX file, for example:
    <a HREF="path\file.asx">
    
    Start Windows Media Presentation</a>

  15. Test your Web page by viewing it in Internet Explorer, and clicking your link to the ASX file.

TopBack to top

Converting Existing Digital Audio and Images to ASF

  1. If you do not have Windows Media Player, download the player by clicking this graphic:

    Get Windows Media Player

  2. Install Windows Media Tools. To check if these tools are already installed, open the Windows Start menu. Under the Programs tab, you'll see the Windows Media T.A.G Author in the Windows Media Services folder. This is the tool you'll use for creating your Illustrated Audio presentation.
  3. Gather your media. Insert all of your media (images and audio tracks) into a folder labeled "source." If you don't have an existing audio track, use Sound Recorder for your audio (start > programs > accessories > entertainment > Sound Recorder), or another sound editor. For your images, JPG images (320x240) will produce the best results.
  4. Start the Windows Media T.A.G.Author. A welcome window will appear. Choose the third radio button on the list labeled "Create a New Project." Click OK.
  5. Go to your Source folder. Drag all of your audio into the white "holding bin" area. Move your mouse over the files, and notice the thumbnail image of the file and attributes in the upper left window. In the center of the first row of buttons in the title bar, you are given bandwidth choices (28.8 kbps or 56 kbps). Choose the modem speed equivalent to your connection.
  6. Drag an audio track into the timeline window at the bottom of the T.A.G. Author. The Audio Conversion dialog box appears with a list of compression choices. Choose the option applicable to the connection you selected above. Click OK.
  7. The green bar in the timeline window represents your audio file. The numbers across the top represent the timecode of your presentation in seconds. For example, if the green bar starts at 12 and ends at 34, then your audio track will begin 12 seconds into the presentation and end 34 seconds into the presentation.
  8. If you choose to, you can add more than one audio file, but they cannot overlap in the timecode.
  9. Test your presentation by clicking File > Preview > Media.
  10. Collect your images from your source folder and drag the first image into the timeline window.
  11. The load time of your image file is represented by the blue line. The image will not appear in the presentation until the image is done loading. If you choose to compress the image more, it will appear smaller in the timeline window.
  12. To compress the image, right click on the blue line and select "convert." Change the text area labeled "Quality" to 50. The image is now compressed by 50 percent. Notice the change in appearance of the blue area; it is now cross-haired and smaller in length.
  13. Since you cannot have two images loading at the same time, ensure that the blue areas in the timeline window do not overlap. If the blue line turns red or white, compress the image more or remove one of the images.
  14. Test your presentation by clicking File > Preview > Media.
  15. Go to File > Save, and save your presentation in your Source folder.
  16. Your file will be assigned an .aep extension, not ASF. The AEP file is the project file, while the ASF file is the finished product. Many other files will be created with the AEP file. Keep these files in the same folder and the same directory structure. Don't delete or move them!
  17. Choose File > Publish.
  18. Select the radio button labeled "Custom" under the Window Size heading. Type in 320x240 (or the dimensions you're using) in the associated text box.
  19. Uncheck the rest the boxes. Note: They are used for outputting a web page that will hold the ASF file and other advanced features.
  20. Type the path to the Source folder in the top text box. Select the top check box labeled "ASF file." Click Finish.
  21. Click on the file in your source folder with the new ASF extension. Your file will begin playing.
  22. To place a link to your ASF file from your Web page, you will need to create an ASX file. An ASX file is a text-based metafile that provides a link between your page and the ASF file.
  23. Open your text editor. Copy and paste this code:
    <ASX version="3">
       <Entry>
          <ref HREF="path\file.asf"/>
       </Entry>
    </ASX>
    
  24. Save the file into the same folder as the ASF file. Change the path in the <REF HREF> tag so that it points to your file. The extension must be changed from .txt to .asx.
  25. Test this ASX file by clicking it. You should get the same response as in step #21.
  26. Add an < A HREF> tag to your Web page that points to the ASX file, for example:
    <a HREF="path\file.asx">
    
    Start Windows Media Presentation</a>

  27. Test your Web page by viewing it in Internet Explorer, and clicking your link to the ASX file.

TopBack to top

Posting Your Presentation

Once you have an ASF file, hosting on a server is simple. Web publishers who are just getting started with streaming media and who don't expect high volume viewing of the ASF content can simply place the file on any HTTP server, as they would a WAV or AVI file. For experienced Web publishers who require higher quality and better server resource utilization, it makes sense to host the ASF content on a dedicated streaming server.

To post to an HTTP server, simply place both the ASX and ASF files in the same folder as your Web page as described earlier. To post to a Windows Media Services server, install Windows Media Services Non-MSDN Online link and place the ASF file in an ASF root directory. Place the ASX file in the same folder as the Web page.

In either scenario, for people to be able to view your media, they need to have certain settings called MIME types correctly configured. Installation of the Windows Media Player on most browser configurations usually takes care of these settings. However, for some configurations, you may need to manually set client or server MIME associations. See information on how to manually configure MIME types.

Test your files.

Congratulations! You have just created your first ASF file.



Back to topBack to top

Did you find this material useful? Gripes? Compliments? Suggestions for other articles? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.