teticio commited on
Commit
d7aaca6
1 Parent(s): 6caf083

add sample_rate parameter

Browse files
Files changed (1) hide show
  1. scripts/audio_to_images.py +3 -1
scripts/audio_to_images.py CHANGED
@@ -18,7 +18,8 @@ logger = logging.getLogger('audio_to_images')
18
  def main(args):
19
  mel = Mel(x_res=args.resolution[0],
20
  y_res=args.resolution[1],
21
- hop_length=args.hop_length)
 
22
  os.makedirs(args.output_dir, exist_ok=True)
23
  audio_files = [
24
  os.path.join(root, file) for root, _, files in os.walk(args.input_dir)
@@ -84,6 +85,7 @@ if __name__ == "__main__":
84
  help="Either square resolution or width,height.")
85
  parser.add_argument("--hop_length", type=int, default=512)
86
  parser.add_argument("--push_to_hub", type=str, default=None)
 
87
  args = parser.parse_args()
88
 
89
  if args.input_dir is None:
 
18
  def main(args):
19
  mel = Mel(x_res=args.resolution[0],
20
  y_res=args.resolution[1],
21
+ hop_length=args.hop_length,
22
+ sample_rate=args.sample_rate)
23
  os.makedirs(args.output_dir, exist_ok=True)
24
  audio_files = [
25
  os.path.join(root, file) for root, _, files in os.walk(args.input_dir)
 
85
  help="Either square resolution or width,height.")
86
  parser.add_argument("--hop_length", type=int, default=512)
87
  parser.add_argument("--push_to_hub", type=str, default=None)
88
+ parser.add_argument("--sample_rate", type=int, default=22050)
89
  args = parser.parse_args()
90
 
91
  if args.input_dir is None: