esd and esdrec under OS X Leopard

If you try to use esdrec under OS X, you will find it will simply exit with the following printed to stdout:

usage: program_name [address][:port]

The reason for this is because libesd checks for ipv6 capabilities and if it is present will use it. It prints the above message when it can not connect to the specified host via ipv6. Strangely enough, the default host is "localhost" which is just another name for the ipv4 address of The solution is then to tell esd to bind to ::1 and to tell libesd explicitly to connect to ::1 as well. Thus you need the following:

esd -tcp -bind ::1 &

esdrec -s ::1 | <whatever>