def get_playback_callback(resampler, samplerate, params):
def callback(outdata, frames, time, _):<EOL><INDENT>"""<STR_LIT>"""<EOL>last_fmphase = getattr(callback, '<STR_LIT>', <NUM_LIT:0>)<EOL>df = params['<STR_LIT>'] * resampler.read(frames)<EOL>df = np.pad(df, (<NUM_LIT:0>, frames - len(df)), mode='<STR_LIT>')<EOL>t = time.outputBufferDacTime + np.arange(frames) / samplerate<EOL>phase = <NUM_LIT:2> * np.pi * params['<STR_LIT>'] * t<EOL>fmphase = last_fmphase + <NUM_LIT:2> * np.pi * np.cumsum(df) / samplerate<EOL>outdata[:, <NUM_LIT:0>] = params['<STR_LIT>'] * np.cos(phase + fmphase)<EOL>callback.last_fmphase = fmphase[-<NUM_LIT:1>]<EOL><DEDENT>return callback<EOL>
Return a sound playback callback.

    Parameters
    ----------
    resampler
        The resampler from which samples are read.
    samplerate : float
        The sample rate.
    params : dict
        Parameters for FM generation.