def rate(self, samplerate, quality='<STR_LIT:h>'):
quality_vals = ['<STR_LIT:q>', '<STR_LIT:l>', '<STR_LIT:m>', '<STR_LIT:h>', '<STR_LIT:v>']<EOL>if not is_number(samplerate) or samplerate <= <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if quality not in quality_vals:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format('<STR_LIT:U+0020>'.join(quality_vals))<EOL>)<EOL><DEDENT>effect_args = [<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'.format(quality),<EOL>'<STR_LIT>'.format(samplerate)<EOL>]<EOL>self.effects.extend(effect_args)<EOL>self.effects_log.append('<STR_LIT>')<EOL>return self<EOL>
Change the audio sampling rate (i.e. resample the audio) to any
        given `samplerate`. Better the resampling quality = slower runtime.

        Parameters
        ----------
        samplerate : float
            Desired sample rate.
        quality : str
            Resampling quality. One of:
             * q : Quick - very low quality,
             * l : Low,
             * m : Medium,
             * h : High (default),
             * v : Very high

        See Also
        --------
        upsample, downsample, convert