Home arrow Flash arrow Create a Flash Speech Synthesizer
FLASH

Create a Flash Speech Synthesizer


This hack uses Flash sound events to splice sound samples seamlessly together to simulate one continuous sound effect, in this case digitized speech using allophones (phonetic speech sections from which the spoken word is built up). (Hack 52 from the book, Flash Hacks, by Sham Bhangal, O'Reilly Media, 2004, ISBN: 0596006454.)

Author Info:
By: O'Reilly Media
Rating: 5 stars5 stars5 stars5 stars5 stars / 32
October 06, 2004
TABLE OF CONTENTS:
  1. · Create a Flash Speech Synthesizer
  2. · Sound File
  3. · Repeat the Sound
  4. · Phonetic Speech Synthesizer
  5. · Final Thoughts

print this article
SEARCH DEVARTICLES

Create a Flash Speech Synthesizer
(Page 1 of 5 )

BhangalSynthesize speech for added flexibility with reduced bandwidth—no need to record or download predetermined sounds.

This hack uses Flash sound events to splice sound samples seamlessly together to simulate one continuous sound effect, in this case digitized speech using allophones (phonetic speech sections from which the spoken word is built up).

The Trouble with Lasers

Some hacks rely on standard techniques or technologies used for an unexpected application. Science is filled with unexpected uses of technologies, such as lasers. Few envisioned that lasers could be used for everything from warfare to surgery, to listen to music, watch movies, and transmit international phone conversations.

In this hack, we’ll see how the seemingly innocuous onSoundComplete event can be used to create a speech synthesizer in Flash.

Using Sound.onSoundComplete Event

As soon as the Sound.onSoundComplete( ) method came out in Flash MX, I thought, “Cool! We can now easily synchronize sound accurately enough to create a sound mixing board,” and sure enough, we can. The onSoundComplete event is accurate to a resolution of around 10 times the frame rate, so it’s far more accurate than the keyframe/onEnterFrame-based sound controls common in Flash 5.

Like all event-driven code, onSoundComplete events might be delayed if there is a lot of other stuff going on at the same time, particularly processor-intensive animation. Overtaxing the Flash Player may result in slight hitches (delays) in playback, so go easy!

Have a look at the following code (or have a look at the file groovyLoop.fla from this book’s web site):

function nextSound () {
  myLoop.start();
}
myLoop = new Sound(this);
myLoop.attachSound("groovy");
myLoop.start();
myLoop.onSoundComplete = nextSound;

Buy the book!If you've enjoyed what you've seen here, or to get more information, click on the "Buy the book!" graphic. Pick up a copy today!

Visit the O'Reilly Network http://www.oreillynet.com for more online content.


blog comments powered by Disqus
FLASH ARTICLES

- More Top Flash Game Tutorials
- Top Flash Game Tutorials
- Best Flash Photo Gallery Tutorials
- The Top Flash Tutorials for Menus
- 7 Great Flash Tutorials
- Adobe Creative Suite 5.5 Now Available
- Critical Flash Vulnerability Heats Up the Web
- More on Nonpersistent Client-Side Remote Sha...
- Nonpersistent Client-Side Remote Shared Obje...
- Using the Decorator Pattern for a Real Web S...
- Using Concrete Decorator Classes
- Delving More Deeply into the Decorator Patte...
- The Decorator Pattern in Action
- A Simple Decorator Pattern Example
- Decorator Pattern

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials