SasAudio: Compute envelope duration on state changes only.
More minor SasAudio optimizations