<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>Zach Archer Blog &#187; as3</title> <atom:link href="http://blog.zacharcher.com/tag/as3/feed/" rel="self" type="application/rss+xml" /><link>http://blog.zacharcher.com</link> <description>Friend to analog and digital alike</description> <lastBuildDate>Tue, 10 Jan 2012 06:24:29 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Synthetic Speech in Flash: the Source Code</title><link>http://blog.zacharcher.com/2012/01/09/synthetic-speech-in-flash-the-source-code/</link> <comments>http://blog.zacharcher.com/2012/01/09/synthetic-speech-in-flash-the-source-code/#comments</comments> <pubDate>Tue, 10 Jan 2012 05:49:27 +0000</pubDate> <dc:creator>Zach</dc:creator> <category><![CDATA[Flash]]></category> <category><![CDATA[Synth]]></category> <category><![CDATA[as3]]></category> <category><![CDATA[code]]></category> <category><![CDATA[robots]]></category> <category><![CDATA[source]]></category> <category><![CDATA[speech]]></category> <category><![CDATA[synthetic]]></category> <category><![CDATA[talking]]></category> <guid
isPermaLink="false">http://blog.zacharcher.com/?p=326</guid> <description><![CDATA[Remember the Flash synthetic speech demo, which turned into a talking robot app? Here's the source code: Download it! Please note: This code comes with no warranty, nor support, whatsoever. None. Zip. Nada. If your talking robots become self-aware and enslave humanity, then I will not be held responsible. But if you're in the mood [...]]]></description> <content:encoded><![CDATA[<p>Remember the <a
href="http://blog.zacharcher.com/2009/08/27/synthetic-speech-in-flash/">Flash synthetic speech demo</a>, which turned into a <a
href="http://blog.zacharcher.com/2010/01/03/here-comes-the-metal-mouth/">talking robot app</a>? Here's the source code: <strong><a
href="http://zacharcher.com/lab/20120109_as3_speech/as3_speech.zip">Download it</a></strong>!</p><p><img
class="aligncenter" src="http://zacharcher.com/lab/20120109_as3_speech/supercali.png" alt="SUPERCALIFRAGILISTICEXPEALIDOSHUS" width="380" height="328" /></p><p>Please note: This code comes with no warranty, nor support, whatsoever. None. Zip. Nada. If your talking robots become self-aware and enslave humanity, then I will not be held responsible. But if you're in the mood for tinkering, here's how it's strung together:</p><ul><li>The sound is generating using <a
href="http://en.wikipedia.org/wiki/Linear_predictive_coding">Linear Predictive Coding</a> ("LPC").</li><li>First, some Python code: The <em>analyze_lpc.py</em> script analyzes <em>phonemes.dat</em> (which is just a headerless version of <em>phonemes.aif</em>). Individual phonemes are separated by moments of silence, so the script splits the sound file on those. Each phoneme is converted to LPC data, using code that I ported from <a
href="http://soundlab.cs.princeton.edu/software/rt_lpc/">the rt_lpc project</a>. I felt like I understood the mathematics 3 years ago, but I doubt I could explain it today.</li><li>Now, in Flash: Launch the <em>DictCompressor</em> application, and watch the trace messages. Click the screen to open the browser window, then select your <em>cmudict___.txt</em> pronouncing dictionary. (You can obtain the latest CMUdict <a
href="http://www.speech.cs.cmu.edu/cgi-bin/cmudict">here</a>.) Flash will convert this to a (smaller) <em>cmudict.dat</em> file, which is what <em>LPCsynth.swf</em> loads.</li><li><em>LPCsynth</em> is the application that talks. The <em>LPCSynthHarness.sayItNow()</em> method creates an array of <em>LPCFrames</em>, which are "spoken" in the <em>sampleData()</em> method.  This was never intended for public distribution, so the code is not exactly stellar (the talking bit should be extracted into its own class).</li></ul><p>Is this interesting? Did your Flash Player become self-aware after hearing its own voice? Let me know!</p><p>It's funny, originally this was intended for the <a
href="http://controlzinc.com/">controlzinc.com</a> website. The robot voice would sing as you clicked, crooning about your mousing habits. I still can't decide if that idea was brilliant, or terrible.</p><div
class='bookmarkify'><a
name='bookmarkify'></a><div
class='linkbuttons'><a
href='http://www.facebook.com/share.php?u=http://blog.zacharcher.com/2012/01/09/synthetic-speech-in-flash-the-source-code/' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img
src='http://blog.zacharcher.com/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a
href='http://reddit.com/submit?url=http://blog.zacharcher.com/2012/01/09/synthetic-speech-in-flash-the-source-code/&amp;title=Synthetic Speech in Flash: the Source Code' title='Reddit' onclick='target="_blank";' rel='nofollow'><img
src='http://blog.zacharcher.com/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a
href='http://twitter.com/home/?status=Synthetic Speech in Flash: the Source Code+http://blog.zacharcher.com/2012/01/09/synthetic-speech-in-flash-the-source-code/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img
src='http://blog.zacharcher.com/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a> <a
href='http://www.feedburner.com/fb/a/emailFlare?itemTitle=Synthetic Speech in Flash: the Source Code&amp;uri=http://blog.zacharcher.com/2012/01/09/synthetic-speech-in-flash-the-source-code/&amp;loc=en_US' title='Email this to a friend' onclick='target="_blank";' rel='nofollow'><img
src='http://blog.zacharcher.com/wp-content/plugins/bookmarkify/email.png' style='width:16px; height:16px;' alt='[Email] ' /></a> <a
title='See more bookmark and sharing options...' href='http://blog.zacharcher.com/2012/01/09/synthetic-speech-in-flash-the-source-code/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div>]]></content:encoded> <wfw:commentRss>http://blog.zacharcher.com/2012/01/09/synthetic-speech-in-flash-the-source-code/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Flocking</title><link>http://blog.zacharcher.com/2008/06/01/flocking/</link> <comments>http://blog.zacharcher.com/2008/06/01/flocking/#comments</comments> <pubDate>Mon, 02 Jun 2008 02:40:29 +0000</pubDate> <dc:creator>Zach</dc:creator> <category><![CDATA[wordpress]]></category> <category><![CDATA[as3]]></category> <category><![CDATA[birds]]></category> <category><![CDATA[Flash]]></category> <category><![CDATA[flocking]]></category> <category><![CDATA[ui]]></category> <guid
isPermaLink="false">http://blog.zacharcher.com/?p=18</guid> <description><![CDATA[AI for Game Developers has a chapter on flocking, and I thought I'd try it: Click to play! It's not polished, but it lets you explore different flocking behaviors. Here's what the controls do: count The number of "birds" in the simulation. alignmentRadius Birds rotate to match the direction of their neighbors. This parameter changes [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://www.amazon.com/AI-Game-Developers-David-Bourg/dp/0596005555/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1212373628&amp;sr=8-1">AI for Game Developers</a> has a chapter on <a
href="http://en.wikipedia.org/wiki/Flocking_%28behavior%29">flocking</a>, and I thought I'd try it:</p><p><a
href="http://zacharcher.com/lab/20080601_flocking/FlockingTest.swf"><img
src="http://zacharcher.com/lab/20080601_flocking/flocking.png" alt="" /></a></p><p><a
href="http://zacharcher.com/lab/20080601_flocking/FlockingTest.swf">Click to play!</a> It's not polished, but it lets you explore different flocking behaviors. Here's what the controls do:</p><p><span
id="more-18"></span></p><ul><li><strong>count</strong> The number of "birds" in the simulation.</li><li><strong>alignmentRadius</strong> Birds rotate to match the direction of their neighbors. This parameter changes how far away they can "see". Larger values tend to align the entire flock; small values let the flock break apart.</li><li><strong>separationRadius</strong> Birds try to avoid colliding with nearby walls and other birds. They will turn and simultaneously hit the brakes. This number controls their stopping distance.</li><li><strong>peripheralVision</strong> Birds have a blind spot behind them. When this slider is maximized, the birds will have no blind spot, and will see 360 degrees.</li><li><strong>turnSpeed</strong> The speed at which birds turn.</li><li><strong>brakePedal</strong> Birds will slow down to avoid colliding. When this slider is minimized, the birds will never use their brakes.</li><li><strong>travelSpeed</strong> The top speed of the birds.</li><li><strong>Scatter</strong> and <strong>Randomize</strong>: Try them and see...</li></ul><p>If you want access to the code, the SubVersion repository is open: <a
href="http://dev.zacharcher.com/svn/flocking_test/">http://dev.zacharcher.com/svn/flocking_test/</a></p><div
class='bookmarkify'><a
name='bookmarkify'></a><div
class='linkbuttons'><a
href='http://www.facebook.com/share.php?u=http://blog.zacharcher.com/2008/06/01/flocking/' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img
src='http://blog.zacharcher.com/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a
href='http://reddit.com/submit?url=http://blog.zacharcher.com/2008/06/01/flocking/&amp;title=Flocking' title='Reddit' onclick='target="_blank";' rel='nofollow'><img
src='http://blog.zacharcher.com/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a
href='http://twitter.com/home/?status=Flocking+http://blog.zacharcher.com/2008/06/01/flocking/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img
src='http://blog.zacharcher.com/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a> <a
href='http://www.feedburner.com/fb/a/emailFlare?itemTitle=Flocking&amp;uri=http://blog.zacharcher.com/2008/06/01/flocking/&amp;loc=en_US' title='Email this to a friend' onclick='target="_blank";' rel='nofollow'><img
src='http://blog.zacharcher.com/wp-content/plugins/bookmarkify/email.png' style='width:16px; height:16px;' alt='[Email] ' /></a> <a
title='See more bookmark and sharing options...' href='http://blog.zacharcher.com/2008/06/01/flocking/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div>]]></content:encoded> <wfw:commentRss>http://blog.zacharcher.com/2008/06/01/flocking/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
