I noticed that the alacconvert released by Apple.Inc can only output file as .caf (not .m4a).
http://alac.macosforge.org/trac/wiki (http://alac.macosforge.org/trac/wiki)
Although it's just a matter of container, foobar2000 so far doesn't support this filetype and I cannot find any plugins.
So is there any plugin for foobar2000 that I can play .caf file directly?
Well the answer to the title of your post is that someone would have to write a plugin to play it.
you could use the refalac encoder which is based on apple's open source code. it creates ALAC files in an .m4a container.
https://github.com/nu774/qaac/wiki/refalac-usage (https://github.com/nu774/qaac/wiki/refalac-usage)