sarabsethi / false_colour_index_spectrogram

Generate a false colour index spectrogram to visualise long-duration soundscape recordings
GNU General Public License v3.0
27 stars 8 forks source link

Error in librosa_audio_modded.py #10

Open Mishachandar opened 3 years ago

Mishachandar commented 3 years ago

if name=='main': import argparse

#default_in  = '/home/dans/birdsong/bl_dawnchorus_atmospheres/as_mono/022A-WA09020XXXXX-0916M0.flac'
default_in  = 'F:/wavfiles/37SLgW26.wav'
#default_in  = '/home/dans/birdsong/jolle/20120203-AU1.WAV'
default_out = 'output_spectrograms_1_week_from_16_nov_17_e100'

parser = argparse.ArgumentParser()
parser.add_argument("inpaths", nargs='*', default=default_in, help="Input path: can be a path to a single file (which will be chunked), or a folder full of wavs, or the input can be a list of wav files which you explicitly specify")
parser.add_argument("-o", default=default_out, type=str, help="Output path: a folder (which should exist already) in which data files will be written.")
parser.add_argument("-c", default=1, type=int, choices=[0,1], help="Whether to calculate the stats afresh. Use -c=0 to reuse previously calculated stats.")
parser.add_argument("-n", default=0, type=int, choices=[0,1], help="Whether to apply scaling (normalisation) of the statistics before plotting them.")
parser.add_argument("--savef", default='', type=str, help="Image file where the output figure should be saved (including extension (png, jpg, etc.). Expect issues with vector graphics")
parser.add_argument("--hop", default=100, type=float, help="How much to advance each 'frame', as a percentage of the 1-min framesize. Default of 100%% is recommended for long >2hr. For 1hr audio you could try 25 for finer resolution.")
parser.add_argument("--fmin", default=0, type=float, help="Lowest frequency (in Hz) to show on the plot.")
parser.add_argument("--fmax", default=44100, type=float, help="Highest frequency (in Hz) to show on the plot.")
args = parser.parse_args()
print args

Error: print args ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(args)?**

danstowell commented 3 years ago

The error actually occurs in calculate_index_spectrograms.py. This is a very common error in Python 2 code being run on Python 3 - it should be easy for someone to upgrade the code for Python 3!