Skip to content
Snippets Groups Projects
Commit 66d182ed authored by Stephane Chavin's avatar Stephane Chavin
Browse files

Update file get_spectrogram.py

parent 36b3481b
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,7 @@ def process_recordings(data, img_per_rec, args): ...@@ -42,7 +42,7 @@ def process_recordings(data, img_per_rec, args):
duration = args.duration duration = args.duration
overlap = args.overlap overlap = args.overlap
for count in range(args.img_per_rec): for count in range(img_per_rec):
offset = count * (duration - overlap) offset = count * (duration - overlap)
filename = str(i[0]) filename = str(i[0])
...@@ -54,8 +54,8 @@ def process_recordings(data, img_per_rec, args): ...@@ -54,8 +54,8 @@ def process_recordings(data, img_per_rec, args):
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, description='Extract spectrogram for each .wav file') parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, description='Extract spectrogram for each .wav file')
parser.add_argument('path_to_data', type=arg_directory, help='Path of the folder that contains the recordings', required=True) parser.add_argument('path_to_data', type=arg_directory, help='Path of the folder that contains the recordings')
parser.add_argument('directory', type=arg_directory, help='Directory to which spectrograms will be stored', required=True) parser.add_argument('directory', type=arg_directory, help='Directory to which spectrograms will be stored')
parser.add_argument('-m', '--mode', type=str, choices=['unique', 'multiple'], help='Direction of the saved spectrogram', default='multiple') parser.add_argument('-m', '--mode', type=str, choices=['unique', 'multiple'], help='Direction of the saved spectrogram', default='multiple')
parser.add_argument('-n', '--columns_name', type=str, help='Name of the columns that contain the path of the .wav', default='Path') parser.add_argument('-n', '--columns_name', type=str, help='Name of the columns that contain the path of the .wav', default='Path')
parser.add_argument('-i', '--input', type=str, choices=['file', 'folder'], help='Choose "file" if you have a .csv file or "folder" to export ' parser.add_argument('-i', '--input', type=str, choices=['file', 'folder'], help='Choose "file" if you have a .csv file or "folder" to export '
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment