spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column83


Embedding Sound with Flash, Part III: Streams

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Playing Streams

Flash file format supports four different types of sync: event, start, stop, and stream. An event sync allows you to play multiple tracks at the same time. A start sync avoids parallel tracks. A stop sync stops tracks. A stream sync sound consists of frame-sized chunks of sound that play back to back seamlessly. Unlike true streaming audio formats like Real Audio, a Flash stream file loads into the browser as it plays. At the end of the playback, the stream sound is fully loaded in the browser cache. A subsequent playback comes from the browser cache rather than loading from the Web (as is the case with Real Audio).

The following link plays a stream sync that explains the FlashSound JavaScript API. Click it:

Play the Tutorial

Here is the source code:

<HTML>
<HEAD>
  <SCRIPT SRC="flashsound.js"></SCRIPT>
  <SCRIPT>
    var mySoundObj = new FlashSound();
  </SCRIPT>
</HEAD>
<BODY>
<SCRIPT>
  mySoundObj.embedSWF("earsonly.swf");
</SCRIPT>
</BODY>
</HTML>

Notice that the Flash sound was set in the Flash editor to autostart.

Next: How to start a stream from a designated frame

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: May 7, 2001
Revised: May 7, 2001

URL: http://www.webreference.com/js/column83/3.html