def get_input_callback(samplerate, params, num_samples=<NUM_LIT>):
amplitude = params['<STR_LIT>']<EOL>frequency = params['<STR_LIT>']<EOL>def producer():<EOL><INDENT>"""<STR_LIT>"""<EOL>start_time = <NUM_LIT:0><EOL>while True:<EOL><INDENT>time = start_time + np.arange(num_samples) / samplerate<EOL>start_time += num_samples / samplerate<EOL>output = amplitude * np.cos(<NUM_LIT:2> * np.pi * frequency * time)<EOL>yield output<EOL><DEDENT><DEDENT>return lambda p=producer(): next(p)<EOL>
Return a function that produces samples of a sine.

    Parameters
    ----------
    samplerate : float
        The sample rate.
    params : dict
        Parameters for FM generation.
    num_samples : int, optional
        Number of samples to be generated on each call.