<s> '''<STR_LIT>''' <EOL> from __future__ import print_function <EOL> import argparse <EOL> import sys <EOL> import librosa <EOL> def adjust_tuning ( input_file , output_file ) : <EOL> '''<STR_LIT>''' <EOL> print ( '<STR_LIT>' , input_file ) <EOL> y , sr = librosa . load ( input_file ) <EOL> print ( '<STR_LIT>' ) <EOL> y_harm = librosa . effects . harmonic ( y ) <EOL> print ( '<STR_LIT>' ) <EOL> tuning = librosa . estimate_tuning ( y = y_harm , sr = sr ) <EOL> print ( '<STR_LIT>' . format ( <NUM_LIT:100> * tuning ) ) <EOL> print ( '<STR_LIT>' . format ( - <NUM_LIT:100> * tuning ) ) <EOL> y_tuned = librosa . effects . pitch_shift ( y , sr , - tuning ) <EOL> print ( '<STR_LIT>' , output_file ) <EOL> librosa . output . write_wav ( output_file , y_tuned , sr ) <EOL> def process_arguments ( args ) : <EOL> '''<STR_LIT>''' <EOL> parser = argparse . ArgumentParser ( description = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , <EOL> action = '<STR_LIT:store>' , <EOL> help = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , <EOL> action = '<STR_LIT:store>' , <EOL> help = '<STR_LIT>' ) <EOL> return vars ( parser . parse_args ( args ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> params = process_arguments ( sys . argv [ <NUM_LIT:1> : ] ) <EOL> adjust_tuning ( params [ '<STR_LIT>' ] , params [ '<STR_LIT>' ] ) </s>
