Baguette AMF, AmfPHP at the Speed of Light

AMF is a very compact binary format. It is however difficult to parse. AmfPHP on its own does a good job, but it takes time, as it is written in PHP. Baguette AMF is written in C, and therefore enjoys native performance. This means up to 20 times faster conversion times.  This is good for both providing a better experience to your users, and saving on extra servers.

Yes, It’s commercial

The business model around AmfPHP has always been to sell service around the project and keep it free. The problem is, the better the documentation and the code, the less the community needs service. So each time I add to the project I’m asking myself if it’s not hurting my bottom line. So the idea here is to shift away from that approach and towards making money off Baguette AMF, while keeping AmfPHP free.

The pricing model isn’t settled yet, so I’m open to suggestions here.It’s in private beta, and this is one of the points that are up for discussion. Feedback is very welcome!

Check it out

Pin It

amfPHP and GraniteDS?

I recently had lunch with the good folks of GraniteDS, which among other things handles AMF for Java. We agree that it would be really cool to do something together. We are seriously considering a small project to start collaborating and test the waters: a website that promotes the AMF format. One other possible overlap is client code generation. Then we have some seriously pie in the sky projects like mixing JSON and AMF. It’s just at the planning stage for now, so stay tuned!

Pin It

Haxe WWX Conference, what’s next

I was there with my Silex Labs crew who organized it. We had a great time and it was a very positive vibe. Our story on it is here.

Haxe right now is at a crossroad. It’s mature enough as a technology to go mainstream, and I think the market is ready for it.  Client platforms are very uncertain at the moment. Haxe is not cross-platform. However it is platform independent, meaning that it’s not bound to ios, android, html, etc. , so moving from one platform to another is much less painful than for example an xcode/objective-c/ios project. This makes it very interesting for software shops around the world.

However it needs to attract some big companies to help get it polished enough to not scare people away. Things are moving in the right direction, but the documentation, tooling, communication are sorely lacking. If it had to come under one umbrella term, I think the “developer experience” is not nearly as good as it could be.

I don’t myself sell much Haxe projects, though as a co-founder of Silex Labs I take an interest in it and do some open source work with it. I would like to do more. Right now I’m working on a big PHP project for an international organization, but change is good!

Pin It

Sommeria Search plugin for amfPHP allows to search Twitter

I’ve created a simple plugin for amfPHP that allows your app to search Twitter easily via amfPHP. The idea is to add more search engines later as needed, and to show this as an example of how easy it is to create plugins that add value to the amfPHP ecosystem.

It is branded ‘Sommeria’ rather than ‘amfPHP’ as it does not enhance core functionality as the other plugins distributed with amfPHP do.

download below:


Pin It

Looping Audio in Flash, part 2

this is a follow up post to this one.

I’ve continued building on . And I’ve come up with some improvements:

  • make the loop a separate class
  • allow switching from one loop to another seamlessly.
  • fix a bug that what harmless in a browser but that broke the app on an iphone. In certain cases the previous “extract” method would read beyond the buffer causing the looping to stop.

See below for the code.

Continue reading →

Pin It

Packaging AIR Native Extensions is Horrible, but this Might Help

I’ve just spent the day learning about AIR Native Extensions. The idea is to build an Iphone app with a Flash Builder interface but using native Iphone audio capabilities. It seems that globally things have been well thought out and executed, but there’s one thing that comes across as amazingly pre-alpha craptastic: packaging your native extension. It also happens to be the worst documented, and apparently the worst understood by Adobe’s own team as their articles on the subject are misguided and confused.

The basic bricks you need for an ios only native extension are :

  • an XCode project where you code your native functionality
  • a Flash Builder Library project where you write the AS code that serves as a bridge

And then you would expect that you could point the Library project to your compiled native library, and it would produce a ANE file, ready to use. Right? Right? No.

Continue reading →

Pin It

amfPHP 2.0.1 is out!

Phew, that was hard! The goods here:

Pin It

Looping Audio in Flash

You’d think looping audio in Flash would be trivial, right? think again. There’s enough info on the net to tell you what you need, but it’s a bit dispersed, so here it is condensed. Note that this is about looping audio that is on a server, not embedded in your swf. In that case it works out of the box.

The first thing you need is an uncompressed wave file (.wav) that contains a loop. Flash doesn’t support playback of wav files, so you need to convert it to a compressed format. You have two options here: mp3 or aac.

Mp3 has the advantage to be easy to use in Flash but unfortunately contains padding so looping it as is won’t go smoothly.

AAC can be use in Flash 10 and onwards with some trickery described here : It has the advantage of not containing padding, so it loops almost perfectly. If that’s enough for you, then good. If not, read on.

If you need perfect, then this post has a pretty good method for it. It however does not tell you how to get one necessary information: the number of samples in your loop. If you encode using LAME with the command line (binaries here ), then it will tell you the number of frames. The number of samples per frame is constant with mp3s, it’s 1152. So total number of samples in loop = number of frames * 1152.

Finally, I found this approach to create a loopable mp3 interesting, but I didn’t use it :

Pin It

amfPHP v2 Reloaded is out

the post:

the files:

Pin It

Linked Resources in Flash Builder

When projects relate to each other in Flash Builder, things get messy with paths. Sooner or later you end up with an absolute path in your build configuration, and that means your colleague won’t be able to build on checking out. Relative build paths would be nice, but in the meantime I found a fix that alleviates the pain: Linked Resources. The name doesn’t say much, but what it comes down to is this:

You define a path as a constant, and use it everywhere in your build paths. That way, when your colleague checks out the various projects, the only place that needs to be changed is that constant. To define such a constant, go to Flash Builder Preferences -> General -> Workspace -> Linked Resources. Add a constant, say WORKSPACE_ROOT = /Users/admin/Documents/workspace/, then use it in your project properties. For example to get a project to publish at /Users/admin/Documents/workspace/common, instead of putting that path in Flex Build Path -> Output Folder, you can put ${WORKSPACE_ROOT}/common. In this way, when you set up a workspace, you don’t have to dig through project preferences, but just need to set the Linked Resource.

Pin It