Audio encoder for generating an encoded audio signal, comprising: an audio signal analyzer (516, 520) for analyzing, whether a time frame of the audio signal has a harmonic or speech characteristic; a window function controller for selecting a window function depending on a harmonic or speech characteristic of the audio signal; a windower for windowing the audio signal using the selected window function to obtain a windowed frame; and a processor (508, 512) for further processing the windowed frame to obtain the encoded audio signal; wherein the window function controller comprises a transient detector for detecting a transient, wherein the window function controller is configured for switching from a window function for a long block to a window function for a short block, when a transient is detected and a harmonic or speech characteristic is not found by the audio signal analyzer (516, 520), and for not switching to the window function for the short block, when a transient is detected and a harmonic or speech characteristic is found by the audio signal analyzer (516, 520); and wherein the window function controller is configured for switching from a window function having a length of 2048 samples as the long block, but having a zero portion and a non-aliasing portion, to a window function being longer than the window function for a short block and adapted to obtain a shorter overlap length with a previous window than the window function for a long block and having a zero portion left of an overlap region and a non-aliasing portion right of the overlap region, when a transient is detected and the signal has a harmonic or speech characteristic, such that there is an overlap portion between 1/4 and 1/32 of the whole window function length. an audio signal analyzer (516, 520) for analyzing, whether a time frame of the audio signal has a harmonic or speech characteristic; a window function controller for selecting a window function depending on a harmonic or speech characteristic of the audio signal; a windower for windowing the audio signal using the selected window function to obtain a windowed frame; and a processor (508, 512) for further processing the windowed frame to obtain the encoded audio signal; wherein the window function controller comprises a transient detector for detecting a transient, wherein the window function controller is configured for switching from a window function for a long block to a window function for a short block, when a transient is detected and a harmonic or speech characteristic is not found by the audio signal analyzer (516, 520), and for not switching to the window function for the short block, when a transient is detected and a harmonic or speech characteristic is found by the audio signal analyzer (516, 520); and wherein the window function controller is configured for switching from a window function having a length of 2048 samples as the long block, but having a zero portion and a non-aliasing portion, to a window function being longer than the window function for a short block and adapted to obtain a shorter overlap length with a previous window than the window function for a long block and having a zero portion left of an overlap region and a non-aliasing portion right of the overlap region, when a transient is detected and the signal has a harmonic or speech characteristic, such that there is an overlap portion between 1/4 and 1/32 of the whole window function length.