<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3367287755008284990</id><updated>2011-09-28T10:58:36.008-07:00</updated><category term='sine'/><category term='motion tween'/><category term='flash'/><category term='jQuery'/><category term='fundemental frequency'/><category term='java'/><category term='Actionscript  3'/><category term='audiotranscoder'/><category term='flashsurf'/><category term='alchemy'/><category term='tweenlite'/><category term='ease'/><category term='event'/><category term='kentico features'/><category term='red5'/><category term='xuggle'/><category term='adobe flash'/><category term='context menu'/><category term='frequency analysis'/><category term='HTML 5'/><category term='surf'/><category term='HTML Specifications'/><category term='blogger'/><category term='xuggler'/><category term='animation'/><category term='CMS'/><category term='actionscript 2'/><category term='snow effect'/><category term='Kentico CMS'/><category term='pitch detection'/><category term='Actionscript 3'/><category term='content management system'/><category term='eclipse'/><category term='SyntaxHighlighter'/><category term='pure-data'/><category term='portal engine'/><category term='actionscript'/><category term='Canvas Tag'/><category term='Audio Tag'/><category term='Video'/><category term='Video tag'/><category term='flash professional'/><category term='ease in/out'/><category term='Kentico'/><title type='text'>Ersin's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ersinbasaran.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ersinbasaran.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ersin Basaran</name><uri>http://www.blogger.com/profile/13058131671950879679</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3367287755008284990.post-8203317472762502876</id><published>2009-11-12T03:58:00.000-08:00</published><updated>2009-11-12T03:58:35.210-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flashsurf'/><category scheme='http://www.blogger.com/atom/ns#' term='surf'/><category scheme='http://www.blogger.com/atom/ns#' term='alchemy'/><category scheme='http://www.blogger.com/atom/ns#' term='Actionscript 3'/><title type='text'>ActionScript Surf Library: FlashSurf</title><content type='html'>Currently I'm experimenting with &lt;a href="http://blog.inspirit.ru/?p=343"&gt;FlashSurf library&lt;/a&gt;, an alchemy port of popular &lt;a href="https://code.oregonstate.edu/svn/osurcaerial/trunk/software/SignRecognition/SURF_background.pdf"&gt;Surf algorithm &lt;/a&gt;which is widely used in machine vision problems like object recognition, 3d reconstruction and augmented reality. &lt;br /&gt;&lt;br /&gt;The author, Eugene, does a good job in combining multiple c/c++/java libraries (OpenCV, OpenSurf, libmv SURF, Dlib and JavaSurf) to make Surf algorithm work in AVM. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/"&gt;&lt;span id="goog_1258026304246"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://blog.inspirit.ru/?p=343"&gt;Check out Eugene Blog for the details.&amp;nbsp;&lt;/a&gt;&lt;span id="goog_1258026304247"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;He uses &lt;a href="http://blog.joa-ebert.com/2009/08/05/turbodieselsportinjection/"&gt;TDSI tool&lt;/a&gt; written by Joa for further optimization. I check FlashSurf lib with and without TDSI. It boost the speed a lot. I think anyone experimenting with Actionscript/Alchemy should use it. &lt;br /&gt;&lt;br /&gt;Keep ActionScript'ing...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3367287755008284990-8203317472762502876?l=ersinbasaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ersinbasaran.blogspot.com/feeds/8203317472762502876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3367287755008284990&amp;postID=8203317472762502876' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/8203317472762502876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/8203317472762502876'/><link rel='alternate' type='text/html' href='http://ersinbasaran.blogspot.com/2009/11/actionscript-surf-library-flashsurf.html' title='ActionScript Surf Library: FlashSurf'/><author><name>Ersin Basaran</name><uri>http://www.blogger.com/profile/13058131671950879679</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3367287755008284990.post-508795755645785981</id><published>2009-11-10T04:01:00.000-08:00</published><updated>2009-11-12T04:00:41.241-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snow effect'/><category scheme='http://www.blogger.com/atom/ns#' term='Actionscript  3'/><title type='text'>Snow effect with actionscript 3</title><content type='html'>Recently, I need some snow effect with actionscript. I search the net for samples, and found one. &lt;a href="http://www.tutorio.com/tutorial/flash-snow" target="_blank"&gt;http://www.tutorio.com/tutorial/flash-snow&lt;/a&gt; It was written on ActionScript 2 but the idea was simple.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create several copies of snow Sprite&lt;/li&gt;&lt;li&gt;Let the y-velocity of these snow sprites random&lt;/li&gt;&lt;li&gt;Let the x-positions of these sprites swing by using sine (or cosine) function.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;With the randomization, the output looks realistic. (It was a 10 minute coding, sorry for the quality).&lt;br /&gt;&lt;br /&gt;&lt;object align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" height="300" id="karyag" width="500"&gt;  &lt;param name="allowScriptAccess" value="sameDomain" /&gt;&lt;param name="allowFullScreen" value="false" /&gt;&lt;param name="movie" value="http://sites.google.com/site/ersinbasaran/files/karyag.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;param name="scale" value="exactfit" /&gt;&lt;param name="bgcolor" value="#3366cc" /&gt;&lt;embed src="http://sites.google.com/site/ersinbasaran/files/karyag.swf" quality="high" scale="exactfit" bgcolor="#3366cc" width="500" height="300" name="karyag" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" &gt;&lt;/embed&gt;  &lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Just create a movie clip with linkage class name Snow in Flash Proffesional. Put any graphics you want in it (just a small white circle will be fine). Create anothor movie clip on the stage with linkage class name Snowing. Just play with the randomization parameters for different effects. &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:as3"&gt;package &lt;br /&gt;{&lt;br /&gt; import flash.display.Sprite;&lt;br /&gt; import flash.events.Event;&lt;br /&gt;&lt;br /&gt; public class Snow extends Sprite&lt;br /&gt; {&lt;br /&gt;  private var yVelocity:Number;&lt;br /&gt;  private var xRadius:Number;&lt;br /&gt;  private var xIncrement:Number;&lt;br /&gt;  private var xAngle:Number;&lt;br /&gt;  private var xOrig:Number;&lt;br /&gt;  public function Snow()&lt;br /&gt;  {&lt;br /&gt;   yVelocity = 2 + Math.random() * 5;&lt;br /&gt;   xRadius = 10 + Math.random() * 100;&lt;br /&gt;   xIncrement = 0.001 + Math.random() * 0.05;&lt;br /&gt;   xOrig = Math.random() * 1000;&lt;br /&gt;   xAngle = 2*Math.random()*Math.PI;&lt;br /&gt;   x = xOrig;&lt;br /&gt;   y = Math.random() * 600;&lt;br /&gt;   alpha = 0.2+0.8*Math.random();&lt;br /&gt;   scaleX = scaleY = 0.2+0.8*Math.random();&lt;br /&gt;   addEventListener(Event.ENTER_FRAME, onEnterFrame);&lt;br /&gt;  }&lt;br /&gt;  private function onEnterFrame(e:Event)&lt;br /&gt;  {&lt;br /&gt;   this.y += yVelocity;&lt;br /&gt;   this.x = xOrig + xRadius*Math.sin(xAngle);&lt;br /&gt;   xAngle += xIncrement;&lt;br /&gt;   if (this.y &amp;gt;= 600)&lt;br /&gt;    this.y = 0;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre class="brush:as3"&gt;package &lt;br /&gt;{&lt;br /&gt; import flash.display.Sprite;&lt;br /&gt; &lt;br /&gt; public class Snowing extends Sprite&lt;br /&gt; {&lt;br /&gt;  private var numSnow:int = 1000;&lt;br /&gt;  public function Snowing() &lt;br /&gt;  {&lt;br /&gt;   for (var i = 0; i &amp;lt; numSnow; i++)&lt;br /&gt;   {&lt;br /&gt;    var snow:Snow = new Snow();&lt;br /&gt;    addChild(snow);&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Happy snowing...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3367287755008284990-508795755645785981?l=ersinbasaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ersinbasaran.blogspot.com/feeds/508795755645785981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3367287755008284990&amp;postID=508795755645785981' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/508795755645785981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/508795755645785981'/><link rel='alternate' type='text/html' href='http://ersinbasaran.blogspot.com/2009/11/snow-effect-with-actionscript-3.html' title='Snow effect with actionscript 3'/><author><name>Ersin Basaran</name><uri>http://www.blogger.com/profile/13058131671950879679</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3367287755008284990.post-5234672858804337885</id><published>2009-11-04T01:48:00.000-08:00</published><updated>2009-11-04T02:07:38.589-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='event'/><category scheme='http://www.blogger.com/atom/ns#' term='Video'/><category scheme='http://www.blogger.com/atom/ns#' term='context menu'/><category scheme='http://www.blogger.com/atom/ns#' term='flash professional'/><title type='text'>Flash Player 10 - Context Menu not working on Embedded Video</title><content type='html'>A simple problem: Place an embedded video on stage. Customize context menu using ContextMenu class (flash.ui.ContextMenu). ContextMenuEvent.MENU_ITEM_SELECT event won't fire when you right click on embedded video. Just click on anywhere without video, it will work. If you place a rectangle over the video with 0% alpha fill , it will start working even on the video. This happens with Gaia framework, but i think this is a flash player bug. &lt;br /&gt;&lt;br /&gt;I didn't google if someone else having the same problem or not. Just an unimportant experience.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3367287755008284990-5234672858804337885?l=ersinbasaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ersinbasaran.blogspot.com/feeds/5234672858804337885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3367287755008284990&amp;postID=5234672858804337885' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/5234672858804337885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/5234672858804337885'/><link rel='alternate' type='text/html' href='http://ersinbasaran.blogspot.com/2009/11/flash-player-10-context-menu-not.html' title='Flash Player 10 - Context Menu not working on Embedded Video'/><author><name>Ersin Basaran</name><uri>http://www.blogger.com/profile/13058131671950879679</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3367287755008284990.post-3885790912884679488</id><published>2009-08-18T01:54:00.000-07:00</published><updated>2009-09-19T05:03:14.448-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kentico CMS'/><category scheme='http://www.blogger.com/atom/ns#' term='portal engine'/><category scheme='http://www.blogger.com/atom/ns#' term='kentico features'/><category scheme='http://www.blogger.com/atom/ns#' term='Kentico'/><category scheme='http://www.blogger.com/atom/ns#' term='content management system'/><category scheme='http://www.blogger.com/atom/ns#' term='CMS'/><title type='text'>The Best .NET CMS Solution: Kentico CMS</title><content type='html'>I'm working at &lt;a href="http://www.primeart.net/"&gt;PrimeArt&lt;/a&gt; for 10 years as CTO. In the early days, we we using Perl &amp;amp; PHP as the programming language and MySQL as the database backend. We develop several core CMS software and customize them for various clients and projects.&lt;br /&gt;&lt;br /&gt;When the number of the projects increases the maintenance becomes a big issue. Technology also changes, and you need to adapt them. At core, we are not a development company but a solution provider. We came to a situation that we need to choose a commercial CMS solution. We tested several CMS from different providers and found Kentico CMS as the solution to all of our problems. The version of Kentico CMS was 1.9 at that time.&lt;br /&gt;&lt;br /&gt;The current version of Kentico CMS is 4.0 and it dramatically changed from the first version we used. Regarding the features of the current state I can list the reasons why to choose Kentico CMS:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Excelent support&lt;/span&gt;&lt;br /&gt;One most important thing in using a commercial application is support. During several years, Kentico support team help us to fulfill the project requirements.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Easy development&lt;/span&gt;&lt;br /&gt;Most of our work includes repeated development. We do same things again and again in different projects. Kentico CMS includes a wide range of web parts which satisfies more than 90% of common development tasks. This cuts the development time and since Kentico CMS is a tested platform, the number of bugs to resolve decreased dramatically.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Fast learning curve&lt;/span&gt;&lt;br /&gt;A developer who is familiar with CSS and HTML can start developing sites with just one week of training. The admin interface is very intutive and consistent although the documentation needs more refinement and examples.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Excelent portal engine&lt;/span&gt;&lt;br /&gt;With Kentico CMS Portal Engine, most of the work can be done just using the browser. You do not need to open Visual Studio at all. This allows us even non-programmer web professionals can develop complicated database driven web sites (now also social network sites) without a single lines of code. Also you can add C# codes from the browser. This means that once Kentico CMS is installed on a server, you can even use your IPhone to develop your site (I try, it works :))&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Extensibility&lt;/span&gt;&lt;br /&gt;The requirements can vary a lot from project to project. So you may encounter a situation that you need the change default behaviors supplied by Kentico CMS. Almost every part of it is easy to extend. You can intercept with most of the events (tree handlers, data handlers, workflow handlers, authentication handlers). You can write your own webparts and use them in different projects with the same requirements.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Easy to administer&lt;/span&gt;&lt;br /&gt;Common administration tasks can be performed using the admin interface from the web browser. You can get backups, easily deploy the site to other server, change settings in a&lt;br /&gt;few seconds, check the event log etc.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;The list goes on and on...&lt;/span&gt;&lt;br /&gt;I cannot complete the list here. Please check out their web sites for &lt;a href="http://www.kentico.com/free-cms-asp-net.aspx"&gt;other features&lt;/a&gt;. Also I urge you to &lt;a href="http://www.kentico.com/Download.aspx"&gt;download Kentico CMS&lt;/a&gt; and check it yourself. &lt;/li&gt;&lt;/ul&gt;Keep listing...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3367287755008284990-3885790912884679488?l=ersinbasaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ersinbasaran.blogspot.com/feeds/3885790912884679488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3367287755008284990&amp;postID=3885790912884679488' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/3885790912884679488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/3885790912884679488'/><link rel='alternate' type='text/html' href='http://ersinbasaran.blogspot.com/2009/08/best-net-cms-solution-kentico-cms.html' title='The Best .NET CMS Solution: Kentico CMS'/><author><name>Ersin Basaran</name><uri>http://www.blogger.com/profile/13058131671950879679</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3367287755008284990.post-8601843403944998814</id><published>2009-08-16T04:37:00.000-07:00</published><updated>2009-08-16T05:48:45.419-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Canvas Tag'/><category scheme='http://www.blogger.com/atom/ns#' term='Audio Tag'/><category scheme='http://www.blogger.com/atom/ns#' term='Video tag'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML Specifications'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML 5'/><title type='text'>Next generation of HTML: HTML 5.0</title><content type='html'>It was 1995 when &lt;a href="http://en.wikipedia.org/wiki/Tim_Berners-Lee"&gt;Tim Barners-Lee&lt;/a&gt; published the first formal specifications for HTML (&lt;a href="http://www.ietf.org/rfc/rfc1866.txt"&gt;Hypertext Markup Language - 2.0&lt;/a&gt;). I was in the university at that time, and used internet to download guitar tabs using the terminals of the mainframe with a bandwidth around 100 bytes/sec :). Internet goes very dramatic change until today. Technology starts pushing the boundaries between the physical world and virtual world. However HTML stayed as the core building block. It is very normal for it to adapt the change in requirements. Today allmost all communication, gaming and assistance devices support HTML.&lt;br /&gt;&lt;br /&gt;The current working draft version is HTML 5.0. You can view &lt;a href="http://dev.w3.org/html5/spec/Overview.html"&gt;latest editor version here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Today I had a free time and check the specs. The first thing that hits my eyes was &lt;span style="font-family: courier new;"&gt;audio&lt;/span&gt; and &lt;span style="font-family: courier new;"&gt;video&lt;/span&gt; tags. Until this time, media files are used without any standars. Some developers prefer flash to render video, others use quicktime and windows media player. You need to download the relevant plugins to view the video files. Also the developers should add different HTML tags, and possibly javascript codes, to view and control the videos. With the aid of standard video and audio tags, the user agent will be responsible to render the video. The developer will add standard HTML codes regardless of the media format used in videos. Also for indexing sites, like Google video, these standardization will yield considerably much less work to index the videos.&lt;br /&gt;&lt;br /&gt;Another interesting tag is the &lt;span style="font-family: courier new;"&gt;canvas&lt;/span&gt; tag. With this tag, the developers will be able to dynamicaly generate images on the client side using JavaScript API. If it is supported by the wide range of used agents and devices, it can replace some proprietary tools and methods (like server side generation of images, or plugins like Adobe Flash). Canvas supports (not so) advanced graphics commands like transformation (for scaling and rotation) and shadows.&lt;br /&gt;&lt;br /&gt;One common use of HTML is to display a list of records, like the phone numbers, the bank account history, the list of friends etc. HTML 5.0 introduces a new tag called &lt;span style="font-family: courier new;"&gt;datagrid&lt;/span&gt; to simplify and standardize these types of displays. Traditionally, such data are rendered using the tables. Datagrid allows typed data to be presented in an interactive form to the user. The data can be hierarchical (tree structure) or flat (simple table). It has standard api functions to manipulate and interact with the datagrid. However this section is commented out in the current working draft version. I'm not sure &lt;span style="font-family: courier new;"&gt;datagrid&lt;/span&gt; will be in the final version or not.&lt;br /&gt;&lt;br /&gt;The specification is currently under development. However it is promising that people from Apple, Mozilla and Opera are working together for the specifications that they should obey :).&lt;br /&gt;&lt;br /&gt;That's all for now.&lt;br /&gt;&lt;br /&gt;Keep hypertexting...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3367287755008284990-8601843403944998814?l=ersinbasaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ersinbasaran.blogspot.com/feeds/8601843403944998814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3367287755008284990&amp;postID=8601843403944998814' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/8601843403944998814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/8601843403944998814'/><link rel='alternate' type='text/html' href='http://ersinbasaran.blogspot.com/2009/08/next-generation-of-html-html-50.html' title='Next generation of HTML: HTML 5.0'/><author><name>Ersin Basaran</name><uri>http://www.blogger.com/profile/13058131671950879679</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3367287755008284990.post-3083778824557086065</id><published>2009-08-13T01:08:00.000-07:00</published><updated>2009-08-13T01:54:32.232-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ease'/><category scheme='http://www.blogger.com/atom/ns#' term='actionscript 2'/><category scheme='http://www.blogger.com/atom/ns#' term='motion tween'/><category scheme='http://www.blogger.com/atom/ns#' term='ease in/out'/><category scheme='http://www.blogger.com/atom/ns#' term='sine'/><category scheme='http://www.blogger.com/atom/ns#' term='tweenlite'/><title type='text'>Using Different Ease Functions in ActionScript</title><content type='html'>In previous post I used a formulation for motion tweening based on the update rules in machine learning methods. In this method, you have a target value x&lt;sub&gt;0&lt;/sub&gt; (target position for tween). At each time step, you update the variable x by a percentage of the distance between the target and current. Like the following formation:&lt;br /&gt;&lt;blockquote&gt;x = x + α(x&lt;sub&gt;0&lt;/sub&gt; - x)&lt;br /&gt;&lt;/blockquote&gt;This is also equivalent to&lt;br /&gt;&lt;blockquote&gt;  x = (1-α)x + αx&lt;sub&gt;0&lt;/sub&gt;&lt;/blockquote&gt;This can be used for easing out, not easing in. In this post I'll demonstrate a simple method for easing in&amp;amp;out simultaneously.&lt;br /&gt;&lt;br /&gt;Suppose that the current positin of the movie clip is at x0, and the final (target) position is at x1. We need to find a function which takes x0, x1, t (current time), and tf (total time) as parameters and returns the expected position at time t.&lt;br /&gt;&lt;blockquote&gt;f(x0, x1, t, tf)&lt;/blockquote&gt;We can use sine function for this purpose. The below figure is the sine function between -π/2 and π/2.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_J5qDaJyZ3SQ/SoPPUcVE9LI/AAAAAAAAADU/TRrkUJ2SevY/s1600-h/sine.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 224px;" src="http://3.bp.blogspot.com/_J5qDaJyZ3SQ/SoPPUcVE9LI/AAAAAAAAADU/TRrkUJ2SevY/s320/sine.png" alt="" id="BLOGGER_PHOTO_ID_5369363130864694450" border="0" /&gt;&lt;/a&gt;If we scale the percentage of time between -π/2 and π/2, the sine function returns us the percentage of the position at that time. However we need to scale also the return value from the sine function. The final formulation is like the following&lt;br /&gt;&lt;blockquote&gt;x = f(x0, x1, t, tf) = (x1-x0) sin((t/tf - 0.5)*π)+1)/2&lt;/blockquote&gt;In ActionScript 2.0, you can use the following code where box_mc is the movieclip instance you want to move with ease.&lt;br /&gt;&lt;pre class="brush:as3"&gt;&lt;br /&gt;var t = 0;&lt;br /&gt;var tf = 40;&lt;br /&gt;var x0 = 0;&lt;br /&gt;var x1 = 500;&lt;br /&gt;&lt;br /&gt;onEnterFrame = function ()&lt;br /&gt;{&lt;br /&gt;if (t&amp;lt;tf)&lt;br /&gt;{&lt;br /&gt;box_mc._x = (x1-x0) * (Math.sin((t/tf - 0.5)*Math.PI)+1)/2;&lt;br /&gt;t++;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;You can download the &lt;a href="http://sites.google.com/site/ersinbasaran/files/easesine.zip"&gt;source code&lt;/a&gt;. Checkout the following example. (Google Sites fixes the problem with flash files it should work now)&lt;br /&gt;&lt;br /&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" id="easesine" width="550" align="middle" height="100"&gt;&lt;br /&gt;&lt;param name="allowScriptAccess" value="sameDomain"&gt;&lt;br /&gt;&lt;param name="allowFullScreen" value="false"&gt;&lt;br /&gt;&lt;param name="movie" value="http://sites.google.com/site/ersinbasaran/files/easesine.swf"&gt;&lt;param name="quality" value="high"&gt;&lt;param name="bgcolor" value="#ffffff"&gt; &lt;embed src="http://sites.google.com/site/ersinbasaran/files/easesine.swf" quality="high" bgcolor="#ffffff" name="easesine" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" width="550" align="middle" height="100"&gt;&lt;/embed&gt;&lt;br /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Also check out &lt;a href="http://blog.greensock.com/tweenliteas3/"&gt;TweenLite &lt;/a&gt;which is also used in &lt;a href="http://www.gaiaflashframework.com/"&gt;Gaia Flash Framework&lt;/a&gt;. You will have lots of tweening types like these ones, and you will be able to use them with just a single line of code. It has also very small fingerprint.&lt;br /&gt;&lt;br /&gt;Keep flashing...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3367287755008284990-3083778824557086065?l=ersinbasaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ersinbasaran.blogspot.com/feeds/3083778824557086065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3367287755008284990&amp;postID=3083778824557086065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/3083778824557086065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/3083778824557086065'/><link rel='alternate' type='text/html' href='http://ersinbasaran.blogspot.com/2009/08/using-different-ease-functions-in.html' title='Using Different Ease Functions in ActionScript'/><author><name>Ersin Basaran</name><uri>http://www.blogger.com/profile/13058131671950879679</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_J5qDaJyZ3SQ/SoPPUcVE9LI/AAAAAAAAADU/TRrkUJ2SevY/s72-c/sine.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3367287755008284990.post-7992573082102836149</id><published>2009-08-04T08:53:00.000-07:00</published><updated>2009-08-05T08:42:14.240-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='actionscript 2'/><category scheme='http://www.blogger.com/atom/ns#' term='animation'/><category scheme='http://www.blogger.com/atom/ns#' term='adobe flash'/><category scheme='http://www.blogger.com/atom/ns#' term='actionscript'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Easy Ease with ActionScript 2.0</title><content type='html'>Motion tweening is at the core of Adobe Flash animations. Even you can create tweenings on the stage using the design tools, you can achieve same animations using the action script. This way you can control your animation with the parameters you defined in the code. Once you get used to animating with ActionScript, it will open you a new world of parametric animation.&lt;br /&gt;&lt;br /&gt;Simplest code for ease out is as follows:&lt;br /&gt;&lt;pre class="brush:as3"&gt;&lt;br /&gt;this.onEnterFrame = function() {&lt;br /&gt;box_mc._x += (400-box_mc._x) * 0.2;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;where &lt;code&gt;box_mc&lt;/code&gt; is the movieclip we are animating, 400 is the destination &lt;code&gt;_x&lt;/code&gt; value and 0.2 is ease factor. Interpretation of this: the movieclip (&lt;code&gt;box_mc&lt;/code&gt;) moves 20% of its remaning way at each frame iteration. Suppose that the moviclip is at x-position 0 at the first frame. At the second frame it will be at position 80. At the third frame it will be at position 80 + (400-80)*0.2 = 144. Just put 144 instead of 80 you will get next x position. 144 + (400-144)*0.2 = 195.2. This continues until x position of the movieclip is very close to 400 and the change is almost zero (but not zero).&lt;br /&gt;&lt;br /&gt;Following figure illustrates the effect of changing the ease factor. The x-axis is time and y-axis is the remaining distance from the destination point. Higher ease factor values, more time needed to reach the destination.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_J5qDaJyZ3SQ/Snme7HDBgVI/AAAAAAAAACs/7rGae2h0xYs/s1600-h/ease1.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 148px;" src="http://1.bp.blogspot.com/_J5qDaJyZ3SQ/Snme7HDBgVI/AAAAAAAAACs/7rGae2h0xYs/s320/ease1.gif" alt="" id="BLOGGER_PHOTO_ID_5366495169329856850" border="0" /&gt;&lt;/a&gt;To see the animation, checkout the following:&lt;br /&gt;&lt;br /&gt;&lt;i&gt; &lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;You may not see the following flash animation becase .swf file is hosted on google and an update on google sites breaks flash file playback, so check it later after they fixed the problem.&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://sites.google.com/site/ersinbasaran/files/tweentest.zip"&gt;Download Source&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" id="tweentest" width="550" align="middle" height="240"&gt;&lt;br /&gt;&lt;param name="allowScriptAccess" value="sameDomain"&gt;&lt;br /&gt;&lt;param name="allowFullScreen" value="false"&gt;&lt;br /&gt;&lt;param name="movie" value="http://sites.google.com/site/ersinbasaran/files/tweentest.swf"&gt;&lt;param name="quality" value="high"&gt;&lt;param name="bgcolor" value="#ffffff"&gt; &lt;embed src="http://sites.google.com/site/ersinbasaran/files/tweentest.swf" quality="high" bgcolor="#ffffff" name="tweentest" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" width="550" align="middle" height="240"&gt;&lt;/embed&gt;&lt;br /&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3367287755008284990-7992573082102836149?l=ersinbasaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ersinbasaran.blogspot.com/feeds/7992573082102836149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3367287755008284990&amp;postID=7992573082102836149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/7992573082102836149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/7992573082102836149'/><link rel='alternate' type='text/html' href='http://ersinbasaran.blogspot.com/2009/08/easy-ease-with-actionscript-20.html' title='Easy Ease with ActionScript 2.0'/><author><name>Ersin Basaran</name><uri>http://www.blogger.com/profile/13058131671950879679</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_J5qDaJyZ3SQ/Snme7HDBgVI/AAAAAAAAACs/7rGae2h0xYs/s72-c/ease1.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3367287755008284990.post-4810943765764263239</id><published>2009-07-17T05:15:00.000-07:00</published><updated>2009-08-28T08:55:19.491-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='xuggle'/><category scheme='http://www.blogger.com/atom/ns#' term='audiotranscoder'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='adobe flash'/><category scheme='http://www.blogger.com/atom/ns#' term='red5'/><category scheme='http://www.blogger.com/atom/ns#' term='xuggler'/><title type='text'>Integrating Red5, Xuggler and Pure-Data - Part 2</title><content type='html'>In this post, I demonstrate how to use &lt;a href="http://osflash.org/red5"&gt;Red5&lt;/a&gt;, &lt;a href="http://www.xuggle.com/xuggler/"&gt;Xuggler&lt;/a&gt; and &lt;a href="http://puredata.info/"&gt;PD (Pure-Data)&lt;/a&gt; together for frequency analysis of the sound.&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;What we will try to do is&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Get audio signal from flash client (handled by flash &amp;amp; red5)&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Decode audio file and get raw audio data (handled by xuggle)&lt;/li&gt;&lt;li&gt;Send the raw audio stream to pure-data (no quick solution)&lt;/li&gt;&lt;li&gt;Get the pitch of the sound (handled by pure-data)&lt;/li&gt;&lt;li&gt;Send the pitch of the sound back to red5 (no quick solution)&lt;/li&gt;&lt;li&gt;Send the pitch of the sound back to client (handled by red5 &amp;amp; flash&lt;/li&gt;&lt;/ol&gt;In this post, I will show how to setup the environment for development on Red5.&lt;br /&gt;&lt;br /&gt;In order to develop application in Red5 you need to have an IDE (Integrated Development Environment). Even though you can use command line java compiler (javac) and your favorite text editor (notepad :)), I recommend you to use an IDE.&lt;br /&gt;&lt;br /&gt;Eclipse is an open source java based IDE. You can download Eclipse from &lt;a href="http://www.eclipse.org/downloads/"&gt;http://www.eclipse.org/downloads&lt;/a&gt;. Download and install Eclipse IDE for Java Developers.&lt;br /&gt;&lt;br /&gt;When you run Eclipse for the first time, it will ask you the workspace directory. Workspace is a directory in which all your projects resides (for example java). You can enter &lt;span style="font-family:courier new;"&gt;&amp;lt;RED5_HOME&amp;gt;\webapps\&lt;/span&gt; as the workspace if you will use Eclipse only for this project. Replace &lt;span style="font-family:courier new;"&gt;&amp;lt;RED5_HOME&amp;gt;&lt;/span&gt; with the directory where you install Red5 (ex. c:\Program Files\Red5).&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_J5qDaJyZ3SQ/SmCFTUwdKlI/AAAAAAAAABM/yJTAqbxHx_I/s1600-h/EclipseWorkspace.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 131px;" src="http://1.bp.blogspot.com/_J5qDaJyZ3SQ/SmCFTUwdKlI/AAAAAAAAABM/yJTAqbxHx_I/s320/EclipseWorkspace.gif" alt="" id="BLOGGER_PHOTO_ID_5359430123606846034" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;In the previous post, we install audiotranscoder application. Now we will get the code for this application, change and compile it again.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;To continue please first install audiotranscoder demo application as &lt;a href="http://ersinbasaran.blogspot.com/2009/07/integrating-red5-xuggler-and-pd-part-1.html#InstallAudiotranscoder"&gt;described here&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now you have &lt;code&gt;audiotranscoder&lt;/code&gt; folder under &lt;code&gt;webapps&lt;/code&gt; directory in Red5 installation folder. In order to change audiotranscoder application we need to get source code of this demo application first. You can get the source code of audiotranscoder application from svn archieve. Since The source code is just two files you can download them directly from the following web page:&lt;br /&gt;&lt;a href="http://code.google.com/p/xuggle/source/browse/#svn/trunk/java/xuggle-xuggler-red5/src/com/xuggle/red5/demo"&gt;http://code.google.com/p/xuggle/source/browse/#svn/trunk/java/xuggle-xuggler-red5/src/com/xuggle/red5/demo&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Download &lt;a href="http://xuggle.googlecode.com/svn/trunk/java/xuggle-xuggler-red5/src/com/xuggle/red5/demo/AudioTranscoderDemo.java"&gt;AudioTranscoderDemo.java&lt;/a&gt; and &lt;a href="http://xuggle.googlecode.com/svn/trunk/java/xuggle-xuggler-red5/src/com/xuggle/red5/demo/AudioTranscoderDemoAdapter.java"&gt;AudioTranscoderDemoAdapter.java&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Create a new directory called src under webapps\audiotranscoder. Also create com\eb\red5 directories under src directory. Copy the two java files under this directory. At the end you should have the following files:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;c:\Program Files\Red5\webapps\audiotranscoder\src\com\eb\red5\AudioTranscoderDemo.java&lt;/li&gt;&lt;li&gt;c:\Program Files\Red5\webapps\audiotranscoder\src\com\eb\red5\AudioTranscoderDemoAdapter.java&lt;/li&gt;&lt;/ul&gt; Now we will update these files to reflect our needs.&lt;br /&gt;&lt;br /&gt;First update the package declaration in both files from&lt;pre class="brush:java"&gt;&lt;br /&gt;package com.xuggle.red5.demo;&lt;/pre&gt;&lt;br /&gt;to &lt;pre class="brush:java"&gt;&lt;br /&gt;package com.eb.red5;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Open WEB-INF\red5-web.xml file, find web.handler and change it as the following&lt;br /&gt;&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;bean id="web.handler"&lt;br /&gt;class="com.eb.red5.AudioTranscoderDemoAdapter"&lt;br /&gt;init-method="init"&amp;gt;&lt;br /&gt;&amp;lt;!-- Have the profiler spit out data every 15 seconds --&amp;gt;&lt;br /&gt;&amp;lt;property name="profilerFrequency" value="15"/&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This will tell red5 the name of the class which is responsible to handle the rtmp requests.&lt;br /&gt;&lt;br /&gt;Create a folder called &lt;code&gt;lib&lt;/code&gt; under WEB-INF directory. Copy &lt;code&gt;&amp;lt;XUGGLE_HOME&amp;gt;\share\java\jars\slf4j-api.jar&lt;/code&gt; and &lt;code&gt;&amp;lt;XUGGLE_HOME&amp;gt;\share\java\jars\commons-cli.jar&lt;/code&gt; files to &lt;code&gt;lib&lt;/code&gt; folder. Also you can select copy these files under &lt;code&gt;&amp;lt;RED5_HOME&amp;gt;\lib&lt;/code&gt; folder instead of &lt;code&gt;&amp;lt;READ5_HOME&amp;gt;\webapps\audiotranscoder\WEB-INF\lib&lt;/code&gt; folder. &lt;a href="http://jetm.void.fm/files.html"&gt;Download&lt;/a&gt; and copy jetm.jar file under lib folder.&lt;br /&gt;&lt;br /&gt;Now open eclipse. Select the workspace (c:\program files\red5\webapps). Click File/New/Java Project from main menu. Enter project name as "audiotranscoder". Click Next.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_J5qDaJyZ3SQ/Smc3OPkZ4KI/AAAAAAAAABU/Z6VoBoeXY_4/s1600-h/EclipseNewProject1.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 232px; height: 320px;" src="http://3.bp.blogspot.com/_J5qDaJyZ3SQ/Smc3OPkZ4KI/AAAAAAAAABU/Z6VoBoeXY_4/s320/EclipseNewProject1.gif" alt="" id="BLOGGER_PHOTO_ID_5361314599244783778" border="0" /&gt;&lt;/a&gt;In the next screen, right click on src folder and click on "Use as Source Folder". As default output folder enter audiotranscoder/WEB-INF/classes. If there is no classes folder create it manually.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_J5qDaJyZ3SQ/Smc4FxsabMI/AAAAAAAAABc/1gNI-Fn24YQ/s1600-h/EclipseNewProject2.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 232px; height: 320px;" src="http://3.bp.blogspot.com/_J5qDaJyZ3SQ/Smc4FxsabMI/AAAAAAAAABc/1gNI-Fn24YQ/s320/EclipseNewProject2.gif" alt="" id="BLOGGER_PHOTO_ID_5361315553297984706" border="0" /&gt;&lt;/a&gt;Click on Libraries tab. Click on "Add Library". This will open another form. In this form select "JRE System Library", click next and finish. Click on "Add External JARs..." Select xuggle-xuggler.jar, xuggle-xuggler-red5-3.0.662.jar and spring-core-2.5.6.jar from C:\Program Files\Red5\lib folder. Click "Add External JARs..." again and now select red5.jar from C:\Program Files\Red5 folder. Click on "Add JARs..." and select audiotranscoder\WEB-INF\lib\jetm.jar and slf4j-api-1.5.6.jar. It looks like the following&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_J5qDaJyZ3SQ/Smc57eTgO3I/AAAAAAAAABk/lN5wyd07g9M/s1600-h/EclipseNewProject3.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 232px; height: 320px;" src="http://3.bp.blogspot.com/_J5qDaJyZ3SQ/Smc57eTgO3I/AAAAAAAAABk/lN5wyd07g9M/s320/EclipseNewProject3.gif" alt="" id="BLOGGER_PHOTO_ID_5361317575317797746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Click finish to create the project on Eclipse.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_J5qDaJyZ3SQ/Smc6d4Gz7EI/AAAAAAAAABs/CS33GNl-Smw/s1600-h/EclipseNewProject4.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 269px; height: 320px;" src="http://4.bp.blogspot.com/_J5qDaJyZ3SQ/Smc6d4Gz7EI/AAAAAAAAABs/CS33GNl-Smw/s320/EclipseNewProject4.gif" alt="" id="BLOGGER_PHOTO_ID_5361318166359436354" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now run Red5 from command line (c:\program files\red5\red5.bat). Open your browser and navigate to the address &lt;a href="http://localhost:5080/demos/publisher.html"&gt;http://localhost:5080/demos/publisher.html&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Select Publish tab, enter stream name as "test", select audio device and click Start.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_J5qDaJyZ3SQ/Smc-JPQWA5I/AAAAAAAAAB0/xawHL7txfeo/s1600-h/Publisher1.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 251px;" src="http://4.bp.blogspot.com/_J5qDaJyZ3SQ/Smc-JPQWA5I/AAAAAAAAAB0/xawHL7txfeo/s320/Publisher1.gif" alt="" id="BLOGGER_PHOTO_ID_5361322209842693010" border="0" /&gt;&lt;/a&gt;Select View tab. Enter "xuugle_test" as stream name, rtmp://localhost/audiotranscoder as server location and set Buffer to zero. Click on Connect.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_J5qDaJyZ3SQ/Smc-8yPaMQI/AAAAAAAAACE/VwqB6BiKxZk/s1600-h/Publisher2.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 250px;" src="http://3.bp.blogspot.com/_J5qDaJyZ3SQ/Smc-8yPaMQI/AAAAAAAAACE/VwqB6BiKxZk/s320/Publisher2.gif" alt="" id="BLOGGER_PHOTO_ID_5361323095407341826" border="0" /&gt;&lt;/a&gt;Now you are publishing a stream named "test", it is decoded and encoded again (using PCM which is the raw format)  and published with the stream name "xuggle_test".&lt;br /&gt;&lt;br /&gt;What we will do now is to get the sound data from PCM stream.&lt;br /&gt;&lt;br /&gt;PCM stands for &lt;span style="font-weight: bold;"&gt;P&lt;/span&gt;ulse&lt;span style="font-weight: bold;"&gt;-C&lt;/span&gt;ode &lt;span style="font-weight: bold;"&gt;M&lt;/span&gt;odulation. See &lt;a href="http://en.wikipedia.org/wiki/Pulse-code_modulation"&gt;Wikipedia article&lt;/a&gt; for more information.&lt;br /&gt;&lt;br /&gt;Now click on File/New/Class from Eclipse main menu. Enter com.eb.red5 as package, AudioListener as the name of the class and com.xuggle.red5.AudioSamplesListener as superclass. Leave other options as is and click Finish.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_J5qDaJyZ3SQ/SmdGiA8OqJI/AAAAAAAAACM/v14J8xgWBIw/s1600-h/AudioListener.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 270px; height: 320px;" src="http://4.bp.blogspot.com/_J5qDaJyZ3SQ/SmdGiA8OqJI/AAAAAAAAACM/v14J8xgWBIw/s320/AudioListener.gif" alt="" id="BLOGGER_PHOTO_ID_5361331431589980306" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Paste the following code into AudioListener.java file.&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt;package com.eb.red5;&lt;br /&gt;&lt;br /&gt;import com.xuggle.red5.AudioSamplesListener;&lt;br /&gt;import com.xuggle.xuggler.IAudioSamples;&lt;br /&gt;import com.xuggle.xuggler.IAudioSamples.Format;&lt;br /&gt;&lt;br /&gt;public class AudioListener extends AudioSamplesListener {&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public IAudioSamples postDecode(IAudioSamples object) {&lt;br /&gt;// TODO Auto-generated method stub&lt;br /&gt;long N = object.getNumSamples();&lt;br /&gt;for (long i=0;i&amp;lt;N;i++)&lt;br /&gt;{&lt;br /&gt;long sample = object.getSample(i, 0, Format.FMT_S16);&lt;br /&gt;System.out.println(sample);&lt;br /&gt;}&lt;br /&gt;return super.postDecode(object);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public IAudioSamples postResample(IAudioSamples object) {&lt;br /&gt;// TODO Auto-generated method stub&lt;br /&gt;return super.postResample(object);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public IAudioSamples preEncode(IAudioSamples object) {&lt;br /&gt;// TODO Auto-generated method stub&lt;br /&gt;return super.preEncode(object);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public IAudioSamples preResample(IAudioSamples object) {&lt;br /&gt;// TODO Auto-generated method stub&lt;br /&gt;return super.preResample(object);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;code&gt;AudioListener&lt;/code&gt; will be responsible for listening encoded and decoded streams. While Xuggle decodes the stream, it calls postDecode method with the parameter including the decoded sample. &lt;code&gt;object.getNumSamples();&lt;/code&gt; line gets the number of samples in the decoded part. Remember that &lt;code&gt;postDecode&lt;/code&gt; method is called regularly for a single stream. The number of sample depends on configuration, so in your system it can be 256, 1024 or another number. Suppose that you are decoding a sample sound recorded 8kH. That means that every second we have 8000 samples. If the number of samples is 1024 &lt;code&gt;postDecode&lt;/code&gt; method is called 8000/1024 ~= 8 times in a second. By using &lt;code&gt;getSample&lt;/code&gt; method you can get raw data from decoded stream. Also you can get raw byte array from sample. Check Xuggler API documentation for further information.&lt;br /&gt;&lt;br /&gt;For this to work you should also modify AudioTranscoderDemo.java file and have the following partial code in it.&lt;br /&gt;&lt;br /&gt;Before:&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt; Transcoder transcoder = new Transcoder(aStream,&lt;br /&gt;     outputStream, outputStreamInfo);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After:&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt; AudioListener listener = new AudioListener();&lt;br /&gt; Transcoder transcoder = new Transcoder(aStream,&lt;br /&gt;     outputStream, outputStreamInfo, null, listener, null);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;With this code we create an instance of the class &lt;code&gt;AudioListener&lt;/code&gt; and add this instance to the parameters of constructor of the &lt;code&gt;Transcoder&lt;/code&gt; class.&lt;br /&gt;&lt;br /&gt;Now Eclipse compiles your code automatically. You can restart Red5 server and check the results. Run Publisher demo again and connect to &lt;code&gt;audiotranscode&lt;/code&gt; as described earlier. If you run Red5 server from command line, you will be able to see sound data in the command line, one sample per line. You can do whatever you want with the raw sound data. You can apply filters on it, or you can process it for feature extraction.&lt;br /&gt;&lt;br /&gt;In this post we learned how to setup eclipse to work with Red5-Xuggle application and get the raw sound data. In the next post we will use pure-data to get the pich of the sound.&lt;br /&gt;&lt;br /&gt;Keep coding...&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3367287755008284990-4810943765764263239?l=ersinbasaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ersinbasaran.blogspot.com/feeds/4810943765764263239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3367287755008284990&amp;postID=4810943765764263239' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/4810943765764263239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/4810943765764263239'/><link rel='alternate' type='text/html' href='http://ersinbasaran.blogspot.com/2009/07/integrating-red5-xuggler-and-pure-data.html' title='Integrating Red5, Xuggler and Pure-Data - Part 2'/><author><name>Ersin Basaran</name><uri>http://www.blogger.com/profile/13058131671950879679</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_J5qDaJyZ3SQ/SmCFTUwdKlI/AAAAAAAAABM/yJTAqbxHx_I/s72-c/EclipseWorkspace.gif' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3367287755008284990.post-668314171585491526</id><published>2009-07-16T07:37:00.000-07:00</published><updated>2009-07-17T04:14:53.523-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='SyntaxHighlighter'/><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><title type='text'>Code Syntax Highlighting on Blogger.com</title><content type='html'>I found a good syntax highlighter at the following address &lt;a href="http://alexgorbatchev.com/"&gt;http://alexgorbatchev.com/&lt;/a&gt;and use it on my blog at blogger.com. However there is one big problem with this Javascript library. Since blogger removes new lines (\n) and inserts &amp;lt; br &amp;gt; instead the code looks bad, it only consists of one line and has html break tags in it. In order to fix this problem I also add jQuery hosted by Google and come up with the following code for Layout of my blog:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html" name="code"&gt;&lt;br /&gt;&lt;script language="JavaScript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&amp;lt;link href='http://alexgorbatchev.com/pub/sh/2.0.320/styles/shCore.css' rel='stylesheet' type='text/css'/&amp;gt;&lt;br /&gt;&amp;lt;link href='http://alexgorbatchev.com/pub/sh/2.0.320/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/&amp;gt;&lt;br /&gt;&amp;lt;script language='javascript' src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shCore.js'/&amp;gt;&lt;br /&gt;&amp;lt;script language='javascript' src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushCSharp.js'/&amp;gt;&lt;br /&gt;&amp;lt;script language='javascript' src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushXml.js'/&amp;gt;&lt;br /&gt;&amp;lt;script language='javascript' src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushAS3.js'/&amp;gt;&lt;br /&gt;&amp;lt;script language='javascript' src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushJava.js'/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script language='javascript'&amp;gt;&lt;br /&gt;$(document).ready(function () {&lt;br /&gt;$("pre br").after("\n").remove();&lt;br /&gt;SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/2.0.320/scripts/clipboard.swf';&lt;br /&gt;SyntaxHighlighter.all();&lt;br /&gt;});&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The only line for the fix for blogger.com is the following line:&lt;br /&gt;&lt;pre class="brush:jscript"&gt;&lt;br /&gt;$("pre br").after("\n").remove();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This line uses jQuery in order to modify HTML content. Basically, it finds all &amp;lt;br&amp;gt; tags which are under &amp;lt;pre&amp;gt; tags in DOM hierarchy, adds a new line after these tags and removes them from HTML. Just one line of code doing everything for us. Power of jQuery.&lt;br /&gt;&lt;br /&gt;For each language you want to highlight you need to add the corresponding &amp;lt;script&amp;gt; tag. For example to highlight php you need to add the following line:&lt;br /&gt;&lt;pre class="brush:html"&gt;&lt;br /&gt;&amp;lt;script language='javascript' src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushPhp.js'/&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can check the following link to see the languages supported: &lt;a href="http://alexgorbatchev.com/pub/sh/2.0.320/scripts/"&gt;http://alexgorbatchev.com/pub/sh/2.0.320/scripts/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You need to put your code into a &lt;span style="font-family:courier new;"&gt;&amp;lt;pre&amp;gt;&lt;/span&gt; tag to highlight it. Also you need to add a class attribute like "brush:html" in order for the script know the language you are using. The final code looks like&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html"&gt;&lt;br /&gt;&amp;lt;pre class="brush:jscript"&amp;gt;&lt;br /&gt;function doNothing()&lt;br /&gt;{&lt;br /&gt;  var a = 1;&lt;br /&gt;  var b = 2;&lt;br /&gt;  var nothing = a*b;&lt;br /&gt;  // alert(nothing);&lt;br /&gt;}&lt;br /&gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and this is rendered as&lt;br /&gt;&lt;pre class="brush:jscript"&gt;&lt;br /&gt;function doNothing()&lt;br /&gt;{&lt;br /&gt;  var a = 1;&lt;br /&gt;  var b = 2;&lt;br /&gt;  var nothing = a*b;&lt;br /&gt;  // alert(nothing);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;You should remember that in order to insert &amp;lt; or &amp;gt; characters in HTML or XML, you need to replace them with &amp;amp;lt; and &amp;amp;gt; respectively.&lt;br /&gt;&lt;br /&gt;Keep on posting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3367287755008284990-668314171585491526?l=ersinbasaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ersinbasaran.blogspot.com/feeds/668314171585491526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3367287755008284990&amp;postID=668314171585491526' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/668314171585491526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/668314171585491526'/><link rel='alternate' type='text/html' href='http://ersinbasaran.blogspot.com/2009/07/code-syntax-highligthting-on-bloggercom.html' title='Code Syntax Highlighting on Blogger.com'/><author><name>Ersin Basaran</name><uri>http://www.blogger.com/profile/13058131671950879679</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3367287755008284990.post-7353515789997661878</id><published>2009-07-16T00:51:00.000-07:00</published><updated>2009-08-06T07:04:13.380-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xuggle'/><category scheme='http://www.blogger.com/atom/ns#' term='frequency analysis'/><category scheme='http://www.blogger.com/atom/ns#' term='red5'/><category scheme='http://www.blogger.com/atom/ns#' term='pure-data'/><category scheme='http://www.blogger.com/atom/ns#' term='pitch detection'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><category scheme='http://www.blogger.com/atom/ns#' term='fundemental frequency'/><title type='text'>Integrating Red5, Xuggler and Pure-Data - Part 1</title><content type='html'>In this post, I demonstrate how to use &lt;a href="http://osflash.org/red5"&gt;Red5&lt;/a&gt;, &lt;a href="http://www.xuggle.com/xuggler/"&gt;Xuggler&lt;/a&gt; and &lt;a href="http://puredata.info/"&gt;PD (Pure-Data)&lt;/a&gt; together for frequency analysis of the sound.&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;What we will try to do is&lt;br /&gt;&lt;ol&gt;&lt;li style="font-weight: bold;"&gt;Get audio signal from flash client (handled by flash &amp;amp; red5)&lt;/li&gt;&lt;li&gt;Decode audio file and get raw audio data (handled by xuggle)&lt;/li&gt;&lt;li&gt;Send the raw audio stream to pure-data (no quick solution)&lt;/li&gt;&lt;li&gt;Get the pitch of the sound (handled by pure-data)&lt;/li&gt;&lt;li&gt;Send the pitch of the sound back to red5 (no quick solution)&lt;/li&gt;&lt;li&gt;Send the pitch of the sound back to client (handled by red5 &amp;amp; flash&lt;/li&gt;&lt;/ol&gt;This post includes the installation of required software and the code for the Step 1.&lt;br /&gt;&lt;br /&gt;Red5 is an open source alternative to &lt;a href="http://www.adobe.com/products/flashmediaserver/"&gt;Flash Media Server&lt;/a&gt; (FMS). It is designed to serve and receive multimedia streams to the clients which support &lt;a href="http://www.adobe.com/devnet/rtmp/"&gt;rtmp&lt;/a&gt; protocol. Xuggler is an open source C++ and java library for decoding, encoding and manipulating the video and audio data. Pure-data is an realtime graphical programming environment for audio, video and graphical processing.&lt;br /&gt;&lt;br /&gt;The client application runs on a browser with Flash plugin installed. It access the microphone and sends the audio signal to Red5 using rtmp protocol. Flash uses encoded audio for the streams, therefore we need to decode the audio signal by using Xuggler library. Luckily, Xuggler is already integrated with Red5 and there is a sample red5 application for xuggler called &lt;span style="font-family:courier new;"&gt;audiotranscoder&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;First you need to install Red5. As the time of writing, the latest version of Red5 is 0.8. You can &lt;a href="http://209.20.83.79/downloads/red5/0_8/setup-Red5-0.8.0.exe"&gt;download this version here&lt;/a&gt; for Microsoft Windows. For other OS please follow &lt;a href="http://code.google.com/p/red5/"&gt;this link&lt;/a&gt;. Download the file and run the installer. It installs Red5 to default installation directory (probably C:\Program Files\Red5). It also adds a new windows service called Red5 which runs the server. You can start the service from Services (Control Panel/Administrator Tools/Services). Just right click on the Red5 service and click Start. Also you can manually start Red5 from command line. For this open a command line promt, go to the directory where Red5 is installed, run red5.bat file.&lt;br /&gt;&lt;br /&gt;&lt;a name='InstallAudiotranscoder'&gt;&lt;/a&gt;&lt;br /&gt;After you run Red5 server, from services or command line, open a browser window, and navigate to &lt;a href="http://localhost:5080/"&gt;http://localhost:5080/&lt;/a&gt;. Red5 has also a built in web server by which you can install available applications. Click on the link "Click here to install demos." Red5 Application Installer will list all the available applications. You can select any application and click Install button to deploy that application to the Red5 server. Select audiotranscoder application and click Install.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_J5qDaJyZ3SQ/Sl8U-5FcrWI/AAAAAAAAAAs/XxsYdwi0N9k/s1600-h/Red5ApplicationInstaller.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 206px;" src="http://1.bp.blogspot.com/_J5qDaJyZ3SQ/Sl8U-5FcrWI/AAAAAAAAAAs/XxsYdwi0N9k/s400/Red5ApplicationInstaller.gif" alt="" id="BLOGGER_PHOTO_ID_5359025152302296418" border="0" /&gt;&lt;/a&gt;Now &lt;a href="http://www.xuggle.com/xuggler/downloads/"&gt;download Xuggler&lt;/a&gt; and install it. Also download &lt;a href="http://www.xuggle.com/xuggler/red5/"&gt;Xuggle-Xuggler-Red5 library&lt;/a&gt;. For this click on the Ivy downloads link. Select the version and download &lt;span style="font-family:courier new;"&gt;xuggle-xuggler-red5-xxx.ja&lt;/span&gt;r file. Copy this file to the &lt;span style="font-family:courier new;"&gt;lib &lt;/span&gt;directory in the Red5 installation directory (possibly &lt;span style="font-family:courier new;"&gt;c:\program files\Red5\lib&lt;/span&gt;). Delete existing &lt;span style="font-family:courier new;"&gt;xuggle-xuggler-xxx.jar&lt;/span&gt; &lt;span style="font-family:georgia;"&gt;file&lt;/span&gt; in lib directory. Copy &lt;span style="font-family:courier new;"&gt;xuggle-xuggler.jar&lt;/span&gt; file from Xuggle installation folder (&lt;span style="font-family:courier new;"&gt;c:\program files\Xuggle\share\java\jars&lt;/span&gt;) to lib directory in Red5 installation folder. At the end you should have the following files in Red5 lib directory:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;xuggle-xuggler.jar&lt;/li&gt;&lt;li&gt;xuggle-xuggler-red5-X.X.XXX.jar&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Alter the environment variables with the following changes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Add new environment variable RED5_HOME=C:\program files\Red5&lt;/li&gt;&lt;li&gt;Add new environment variable XUGGLE_HOME=C:\program files\Xuggle&lt;/li&gt;&lt;li&gt;Add Xuggle bin directory (C:\Program files\Xuggle\bin) to the PATH variable. &lt;/li&gt;&lt;/ul&gt;Now we will create a Flash client application which will access the microphone and send the audio to the Red5 server. Open Flash authoring tool and create new flash document and save it to a directory. Also create a new Action Script 3.0 file. Paste the following code and save the file to the directory &amp;lt;fla_directory&amp;gt;\com\eb\red5\FrequencyAnalysis.as (replace &amp;lt;FLA_DIRECTORY&amp;gt; with the directory where you save the .fla file in the previous step):&lt;br /&gt;&lt;pre class="brush:as3"&gt;&lt;br /&gt;&lt;br /&gt;package com.eb.red5 {&lt;br /&gt;import flash.media.Microphone;&lt;br /&gt;import flash.events.NetStatusEvent;&lt;br /&gt;import flash.display.Sprite;&lt;br /&gt;import flash.net.NetConnection;&lt;br /&gt;import flash.net.NetStream;&lt;br /&gt;import flash.net.ObjectEncoding;&lt;br /&gt;import flash.net.SharedObject;&lt;br /&gt;&lt;br /&gt;public class FrequencyAnalysis extends Sprite {&lt;br /&gt;&lt;br /&gt;private var netConnection:NetConnection;&lt;br /&gt;private var nsPublish:NetStream;&lt;br /&gt;private var microphone:Microphone;&lt;br /&gt;private var so:SharedObject;&lt;br /&gt;&lt;br /&gt;public function FrequencyAnalysis() {&lt;br /&gt;   trace("Initialization");&lt;br /&gt;   attachMicrophone();&lt;br /&gt;   netConnection=new NetConnection();&lt;br /&gt;   netConnection.addEventListener(NetStatusEvent.NET_STATUS,checkForConnection);&lt;br /&gt;   netConnection.objectEncoding=ObjectEncoding.AMF0;&lt;br /&gt;   netConnection.connect("rtmp://localhost/audiotranscoder",true);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function receiveMessage(mesg:String) {&lt;br /&gt;   trace("Frequency is " + mesg);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function checkForConnection(event:NetStatusEvent):void {&lt;br /&gt;   trace("Connection Status:"+event.info.code);&lt;br /&gt;   if (event.info.code == "NetConnection.Connect.Success") {&lt;br /&gt;       nsPublish=new NetStream(netConnection);&lt;br /&gt;       nsPublish.bufferTime=0;&lt;br /&gt;       nsPublish.attachAudio(microphone);&lt;br /&gt;       nsPublish.publish("user1","live");&lt;br /&gt;&lt;br /&gt;       so=SharedObject.getRemote("user1",netConnection.uri,false);&lt;br /&gt;       so.client=this;&lt;br /&gt;       so.connect(netConnection);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function attachMicrophone() {&lt;br /&gt;   microphone=Microphone.getMicrophone();&lt;br /&gt;   microphone.gain=80;&lt;br /&gt;   microphone.rate=22;&lt;br /&gt;   microphone.setSilenceLevel(15,2000);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Enter com.eb.red5.FrequencyAnalysis as the class of the .fla file you created.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_J5qDaJyZ3SQ/Sl8f1-whoeI/AAAAAAAAAA8/Jie2kKacntc/s1600-h/FlashClassSetting.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 260px; height: 320px;" src="http://2.bp.blogspot.com/_J5qDaJyZ3SQ/Sl8f1-whoeI/AAAAAAAAAA8/Jie2kKacntc/s320/FlashClassSetting.gif" alt="" id="BLOGGER_PHOTO_ID_5359037093834236386" border="0" /&gt;&lt;/a&gt;&lt;a href="http://puredata.info/downloads"&gt;Download&lt;/a&gt; and install Pure-data extended.&lt;br /&gt;&lt;br /&gt;In order to send the audio stream to pure-data we have to do some dirty things. First download netsend~ and netreceive~ routines for Pure-data from &lt;a href="http://www.remu.fr/sound-delta/netsend%7E/"&gt;this web site&lt;/a&gt;. Go to download section and download netsend~ for pure-data for your operating system. Copy all .dll and .pd files to the extras folder in pure-data installation folder (probably C:\Program Files\pd\extra).&lt;br /&gt;&lt;br /&gt;Open pure-data and create a new file as the following&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_J5qDaJyZ3SQ/Sl8l3sVkmII/AAAAAAAAABE/3vvu6OXyDn4/s1600-h/PDFirstSample.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 158px; height: 200px;" src="http://4.bp.blogspot.com/_J5qDaJyZ3SQ/Sl8l3sVkmII/AAAAAAAAABE/3vvu6OXyDn4/s200/PDFirstSample.gif" alt="" id="BLOGGER_PHOTO_ID_5359043720318851202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;In order to write this program in PD, first launch PD. Create a new empty file by clicking File/New from menu. In order to add the boxes press Ctrl-1 (or from menu select Put/Object) and write down adc~. Press Ctrl-1 again and write fiddle~. Press Ctrl-3 (or from menu select Put/Number). Organize the boxes as displayed in the figure. Connect the boxes by dragging mouse from the relevant port of one box to the relevant port of the other box. Now we wrote our first PD program. Not that tough :)&lt;br /&gt;&lt;br /&gt;Now lets understand what this program does. First adc~ means analog-to-digital converter. It gets the microphone input and converts it to an digital audio signal. fiddle~ receives this signal and performs a pitch analysis on it. The first port at the bottom of fiddle~ box is the pitch of the signal. Since this port is connected to a number box we can see the pitch of the sound realtime using this box.&lt;br /&gt;&lt;br /&gt;In order to run our sample just check Compute Audio checkbox in the main PD window. Now experiment with your voice and check the corresponding pitch.&lt;br /&gt;&lt;br /&gt;In the next post, I will modify the sample Red5 application &lt;span style="font-family:courier new;"&gt;audiotranscoder&lt;/span&gt; to get the raw audio data.&lt;br /&gt;&lt;br /&gt;Keep in rolling...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3367287755008284990-7353515789997661878?l=ersinbasaran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ersinbasaran.blogspot.com/feeds/7353515789997661878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3367287755008284990&amp;postID=7353515789997661878' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/7353515789997661878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3367287755008284990/posts/default/7353515789997661878'/><link rel='alternate' type='text/html' href='http://ersinbasaran.blogspot.com/2009/07/integrating-red5-xuggler-and-pd-part-1.html' title='Integrating Red5, Xuggler and Pure-Data - Part 1'/><author><name>Ersin Basaran</name><uri>http://www.blogger.com/profile/13058131671950879679</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_J5qDaJyZ3SQ/Sl8U-5FcrWI/AAAAAAAAAAs/XxsYdwi0N9k/s72-c/Red5ApplicationInstaller.gif' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
