> Couldn't he codec chip do it by averaging the amplitude?
Yes in principle, but it would be rather complicated -- it would need to have its own microprocessor just to save the speaker. D/A ICs with included amplifiers are already pretty complex. Also, if a user was listening to music that had an occasional high level, the special limiter might kick in and spoil the sound of the audio for a transient that wouldn't actually jeopardize the speakers.
Yes in principle, but it would be rather complicated -- it would need to have its own microprocessor just to save the speaker. D/A ICs with included amplifiers are already pretty complex. Also, if a user was listening to music that had an occasional high level, the special limiter might kick in and spoil the sound of the audio for a transient that wouldn't actually jeopardize the speakers.