I am testing playing sound files with ControlPlayBack using both mp3 and wav16 files. Asterisk seems to play them both nicely with high quality. When using PCMU for the codec of the call which format/encoding would have a lower cost to Asterisk. Is it mp3 or wav16?
Asterisk should work that out for itself given both are available, but I would think that interpolating 16kHz linear to 8kHz linear would be fairly cheap, and 8kHz linear to µ-law should also be fast (I don’t think it is done by table lookup, but it probably could be, given that one can easily spare 256KB, these days.
I thought that MP3 was done with auxiliary programs, which added to the FFTs I assume it uses, would, I think, make it very expensive.
wav16 will, obviously give the highest quality of the two, assuming that the data has been maintained in linear format all the way down to 8kHz linear, before the final transcode to µ-law.