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
Soundclass, new classes includingSoundChannelandSoundMixerhave 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
SoundTransformclass 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access