def main(source_samplerate, target_samplerate, params, converter_type):
from time import sleep<EOL>ratio = target_samplerate / source_samplerate<EOL>with sr.CallbackResampler(get_input_callback(source_samplerate, params),<EOL>ratio, converter_type) as resampler,sd.OutputStream(channels=<NUM_LIT:1>, samplerate=target_samplerate,<EOL>callback=get_playback_callback(<EOL>resampler, target_samplerate, params)):<EOL><INDENT>print("<STR_LIT>")<EOL>try:<EOL><INDENT>while True:<EOL><INDENT>sleep(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>except KeyboardInterrupt:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT><DEDENT>
Setup the resampling and audio output callbacks and start playback.