def fade(self, fade_in_len=<NUM_LIT:0.0>, fade_out_len=<NUM_LIT:0.0>, fade_shape='<STR_LIT:q>'):
fade_shapes = ['<STR_LIT:q>', '<STR_LIT:h>', '<STR_LIT:t>', '<STR_LIT:l>', '<STR_LIT:p>']<EOL>if fade_shape not in fade_shapes:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format("<STR_LIT:U+0020>".join(fade_shapes))<EOL>)<EOL><DEDENT>if not is_number(fade_in_len) or fade_in_len < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if not is_number(fade_out_len) or fade_out_len < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>effect_args = []<EOL>if fade_in_len > <NUM_LIT:0>:<EOL><INDENT>effect_args.extend([<EOL>'<STR_LIT>', '<STR_LIT:{}>'.format(fade_shape), '<STR_LIT>'.format(fade_in_len)<EOL>])<EOL><DEDENT>if fade_out_len > <NUM_LIT:0>:<EOL><INDENT>effect_args.extend([<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT:{}>'.format(fade_shape),<EOL>'<STR_LIT>'.format(fade_out_len), '<STR_LIT>'<EOL>])<EOL><DEDENT>if len(effect_args) > <NUM_LIT:0>:<EOL><INDENT>self.effects.extend(effect_args)<EOL>self.effects_log.append('<STR_LIT>')<EOL><DEDENT>return self<EOL>
Add a fade in and/or fade out to an audio file.
        Default fade shape is 1/4 sine wave.

        Parameters
        ----------
        fade_in_len : float, default=0.0
            Length of fade-in (seconds). If fade_in_len = 0,
            no fade in is applied.
        fade_out_len : float, defaut=0.0
            Length of fade-out (seconds). If fade_out_len = 0,
            no fade in is applied.
        fade_shape : str, default='q'
            Shape of fade. Must be one of
             * 'q' for quarter sine (default),
             * 'h' for half sine,
             * 't' for linear,
             * 'l' for logarithmic
             * 'p' for inverted parabola.

        See Also
        --------
        splice