<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Kevin Thompson</title>
	
	<link>http://kevinthompson.info</link>
	<description>User Experience Engineer</description>
	<lastBuildDate>Mon, 08 Feb 2010 15:34:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/kevinthompson" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="kevinthompson" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Dynamic Spoken Audio With Google’s Text-To-Speech API</title>
		<link>http://kevinthompson.info/articles/dynamic-spoken-audio-with-googles-text-to-speech-api/</link>
		<comments>http://kevinthompson.info/articles/dynamic-spoken-audio-with-googles-text-to-speech-api/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 22:44:34 +0000</pubDate>
		<dc:creator>Kevin Thompson</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://kevinthompson.info/?p=11</guid>
		<description><![CDATA[
As part of my article per week commitment for Project 52, I hope to create regular tutorials and examples on how to use emerging technologies throughout the year. This example uses jQuery, the HTML 5 audio tag, HTML 5 dataset attribute, and the Google Text To Speech API to provide an audible message when actions [...]]]></description>
			<content:encoded><![CDATA[<p>
As part of my article per week commitment for <a href="http://project52.info" class="external">Project 52</a>, I hope to create regular tutorials and examples on how to use emerging technologies throughout the year. This example uses <a href="http://jquery.com/" class="external">jQuery</a>, the <a href="http://www.w3schools.com/html5/tag_audio.asp" class="external">HTML 5 audio tag</a>, <a href="http://dev.w3.org/html5/spec/Overview.html#dom-dataset">HTML 5 dataset attribute</a>, and the <a href="http://translate.google.com" class="external">Google Text To Speech API</a> to provide an audible message when actions are performed.<span id="more-11"></span>
</p>
<h2>The Code</h2>
<h3 class="left-margin"><span>HTML</span></h3>
<pre class="code">
&lt;button class="audible" data-audible="Document Saved."&gt;Save Document&lt;/button&gt;</pre>
<p>HTML 5 is bringing us a number of interesting new tags and attributes to play with. The two that I&#8217;ve made use of here are the <code>audio</code> tag, and the <code>dataset</code> attribute. The audio tag is pretty self explanatory, and can essentially be used to replace flash-based audio players.</p>
<p>
The <code>dataset</code> attribute will come as a relief to javascript developers who&#8217;ve been misusing <code>rel</code> tags for years. John Resig has a <a href="http://ejohn.org/blog/html-5-data-attributes/" class="external">nice write up</a> on this attribute, but to sum it up, he states that the <code>dataset</code> attribute &#8220;allows you to write valid HTML markup (passing an HTML 5 validator) while, simultaneously, embedding data within your page.&#8221;
</p>
<h3 class="left-margin"><span>JavaScript</span></h3>
<pre class="code">
$(function(){
    $('.audible').each(function(){
        // Create Audio Element
        var text = $(this).attr('data-audible');
        text = text.replace(' ','+');
        var audible = new Audio('http://translate.google.com/translate_tts?q=' + text);
        document.body.appendChild(audible);

        // Play Audio On Click
        $(this).click(function(){
            audible.play();
            audible.currentTime = 0;
        });
    });
});</pre>
<p>If you&#8217;re familiar with jQuery, the JavaScript here is actually pretty simple. We start by wrapping everything in the <code>$(function(){ ... });</code> block so that it fires on the onReady event. Next, <code>$('.audible').each(function(){ ... });</code> selects each element with the &#8216;audible&#8217; class and iterates through them. For each element selected, we find the value of the &#8216;data-audible&#8217; attribute, replace spaces with pluses, and pass the Google Text-To-Speech API URL, appended with the audio text, into the audio tag constructor. This produces an audio element which we then append to the body of our page. From here, all that&#8217;s left is to add the functionality to play our new audio element when our original button is clicked: <code>$(this).click(function(){ audible.play(); });</code>.</p>
<p>The final line, <code>audible.currentTime = 0;</code>, is meant to reset the timeline of the audio file, but I&#8217;ve yet to get it working properly (let me know if you&#8217;ve got any insights).</p>
<h2>The Demo</h2>
<p><a href="http://assets.kevinthompson.info/examples/google-text-to-speech-api/" class="external">View the Demo</a> (Working in Safari and Chrome)</p>
<p>The example I&#8217;ve provided really isn&#8217;t an optimal use case, however, as you would probably want to serve the audio after an action is successfully performed server-side, and not simply on click. Dynamic spoken audio obviously doesn&#8217;t fit into too many sites, and it&#8217;s appeal rivals that of the <code>blink</code> tag or midi loops, but in the right situation it may just be useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://kevinthompson.info/articles/dynamic-spoken-audio-with-googles-text-to-speech-api/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://translate.google.com/translate_tts?q=Welcome+to+the+Google+Text+To+Speech+API" length="11664" type="audio/mpeg" />
		</item>
		<item>
		<title>How did I get here?</title>
		<link>http://kevinthompson.info/articles/how-did-i-get-here/</link>
		<comments>http://kevinthompson.info/articles/how-did-i-get-here/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 10:16:25 +0000</pubDate>
		<dc:creator>Kevin Thompson</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://kevinthompson.info/?p=21</guid>
		<description><![CDATA[Though I&#8217;ve been experimenting with web technologies for over 10 years now, my career as a professional web developer began just three years ago when I decided to close my home computer repair business and apply for a job as a search engine optimization engineer. Despite my lack of experience as a web developer and [...]]]></description>
			<content:encoded><![CDATA[<p>Though I&#8217;ve been experimenting with web technologies for over 10 years now, my career as a professional web developer began just three years ago when I decided to close my home computer repair business and apply for a job as a search engine optimization engineer. Despite my lack of experience as a web developer and the fact that I had no portfolio to speak of, I was able to prove a basic understanding of HTML, JavaScript, and CSS, and that was enough.<span id="more-21"></span></p>
<p>The job was meant to be simple HTML manipulation; add alt tags here, meta tags there, externalize javascript, etc. After one day of training as an SEO engineer, the director of engineering informed me that a PHP developer was leaving the company and having boasted about my experience with PHP during my interview, he asked if I would be interested in taking the position. At the time, my &#8220;experience&#8221; with PHP actually didn&#8217;t amount to much more than the use of the <code>include()</code> function, but being an overly-ambitious twenty-something, I proudly accepted the offer.</p>
<p>The months that followed became an exercise in caffeine-fueled sleep deprived autodidacticism. I learned to work with user authentication, sessions, content management, and more. My six months with this company had rapidly expanded my knowledge of PHP, dynamic web development, and search engine optimization, but I had yet to explore web standards, CSS, or JavaScript in depth and was just starting to wrap my brain around table-less layouts.</p>
<p>The time to move on came when my wife-to-be accepted a promotion that would move her three hours out of town. I left my job to follow her, not sure if I would be continuing my career as a web developer, or starting one flipping burgers. Despite the uncertainty, it seemed the universe was looking out for me. The day we moved to town, I came across a newspaper ad for a web developer at one of the two creative agencies in the county. </p>
<p>At the time I thought I was taking another job manipulating HTML, but this new company would come to serve as an incubator for my web development abilities. They gave me the freedom to explore web technologies and to implement cutting edge features and functionality in client work. I began reading .net magazine, following the blogs of many great designers and developers, and digging through documentation on PHP libraries, JavaScript frameworks, and emerging technologies. In this former print and video design agency turned web studio, I quickly became an authority on web technology. The skills I learned during this time truly prepared me for a career a as a web developer.</p>
<p>When my fiance&#8217;s contract for her new position expired, we decided to move back to San Diego, and this meant another change for me. After taking several brief jobs with at small startups and spending a few months freelancing, I attended my first web conference, SXSW. I ended up meeting a couple of guys from a company in San Diego that happened to be in need of a web developer. Upon returning to San Diego, interviews were scheduled and executed leading me into my current position as a user interface engineer.</p>
<p>So far it&#8217;s been an interesting three years and I look forward to seeing what the future has in store.</p>
]]></content:encoded>
			<wfw:commentRss>http://kevinthompson.info/articles/how-did-i-get-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I’m finally going to start blogging. No, seriously. Why are you laughing?</title>
		<link>http://kevinthompson.info/articles/im-going-to-start-blogging/</link>
		<comments>http://kevinthompson.info/articles/im-going-to-start-blogging/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 09:17:57 +0000</pubDate>
		<dc:creator>Kevin Thompson</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://kevinthompson.info/?p=36</guid>
		<description><![CDATA[Over the past few years, I&#8217;ve attempted to begin blogging on several occasions, but I always get hung up on the design of my site (or lack thereof). I try too hard and spend too much time attempting to mimic the sites of designers and developers I admire, never actually producing any content. This year [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few years, I&#8217;ve attempted to begin blogging on several occasions, but I always get hung up on the design of my site (or lack thereof). I try too hard and spend too much time attempting to mimic the sites of designers and developers I admire, never actually producing any content. This year is going to be different.<span id="more-36"></span> </p>
<p>I&#8217;ve installed the latest version of Wordpress with a copy of <a href="http://elliotjaystocks.com/" class="external">Elliot Jay Stocks&#8217;</a> <a href="http://elliotjaystocks.com/starkers/" class="external">Starkers</a> theme and am applying just enough CSS to make this blog easy on the eyes. In order to keep myself motivated, I&#8217;ve also decided to participate in <a href="http://project52.info" class="external">Project52</a>, a challenge to produce fresh content on my site each week for a year.</p>
<p>By the end of 2010 I plan to have at least 52 unique articles; enough content to inspire a new design.</p>
]]></content:encoded>
			<wfw:commentRss>http://kevinthompson.info/articles/im-going-to-start-blogging/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
