De Tout Et De Rien

Aller au contenu | Aller au menu | Aller à la recherche

vendredi 15 février 2008

Time Machine Icon in Menu Bar

Since Mac OS X 10.5.2, there is a Time Machine Icon in the Menu Bar. Have you ever noticed that when a backup is in progress, the icon's clock goes backward ?

mercredi 13 février 2008

Extracting iLBC code from RFC 3951

iLBC (internet Low Bitrate Codec) is a free speech codec suitable for robust voice communication over IP. It is provided as freeware under a royalty-free licence from Global IP Solutions. This codec is used within Skype for the sound transport.

One nice thing is that Global IP Solutions has setup a developer community which provides everything for the iLBC implementation and distribution and they also have submitted two Requests For Comment (RFC 3951 and RFC 3952) related to iLBC codec.

Unfortunately, the source code is not available as a tarball, but it is embedded in the RFC 3951. Yes, it is embedded. You can find various Open Source projects that have extracted the source code and embedded it in their source trunk. But if you want to use the code from the RFC you have to extract it yourself, and the best way is Awk scripting. Here is the script:

# extract.awk
BEGIN { srcname = "nothing"; }
{ if (/^A\.[0-9][0-9]*\.  [a-zA-Z][a-zA-Z_0-9]*\.[ch]/) {
    if (srcname != "nothing")
      close(srcname);
    srcname = $2;
    printf("creating source file %s\n", srcname);
  }else if (srcname != "nothing") {
    if (/Andersen\, et al\./ || /Internet Low Bit Rate Codec *December 2004/)
      printf("skipping %s\n", $0);
    else
      print $0 >> srcname;
  }
}
END {
  printf("ending file %s\n", srcname);
  close(srcname);
}

Put the RFC text and the script in the same folder and run the following comand:

awk -f extract.awk rfc3951.txt

Et Voil !!!