Codec API

I want to use my owm vocoder in Asterisk. Where can I get an information about codec-modules API or some kind of pragrammer’s guide about how to create a codec module for Asterisk?
Thank you.