It would be more logical, and allow easier code reuse, if CODECs were separate from formats. At present this is done informally by making CODEC read/write routines (in particular, the raw, GSM and sndfile ones) globally visible. Indeed, it's not even obvious that CODECs need a different API from formats. But they should have a different type, so they can more easily be wrapped up and reused.