Chapter 11. SOUND
ActionScript 3.0 introduces a new way to work with sound. In addition to adding new classes that afford more granular control over sound management, you can now also access raw sound data including amplitude and frequency spectrum analysis while a sound is playing.
In this chapter, we’ll look at the following topics:
ActionScript Sound Architecture. Beyond the
Sound
class, new classes includingSoundChannel
andSoundMixer
have been added to easily manage multiple channels of sound. Additional classes consolidate volume and pan (moving between stereo channels) manipulation, parsing metadata from MP3 sounds, and more.Internal and External Sounds. We’ll show you how to work with internal sounds found in your library, as well as load external MP3 sounds on the fly.
Playing, Stopping, and Pausing Sounds. In addition to playing and stopping sounds, you’ll learn how to pause and resume playback, as well as stop sound playback in all active channels at once.
Buffering Streaming Sounds. To optimize playback across slower connections, sounds can be buffered, or preloaded. This ensures that sounds play longer without interruption while data continues to download.
Changing Sound Volume and Pan. The
SoundTransform
class gathers volume and panning features, allowing you to increase or decrease volume, and move sounds between the left and right speakers, respectively.Reading ID3 Metadata from MP3 Sounds. During the encoding process, metadata including artist name, track title, and ...
Get Learning ActionScript 3.0 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.