Note to myself:

How to convert random audio files to G.722 with Asterisk

First convert the input file to a 16kHz mono signed linear wave file:

sox input.foo -r 16000 -c 1 -t sw output.sln16

and in the Asterisk CLI:

file convert /path/to/input.sln16 /path/to/output.g722