]> git.0d.be Git - django-panik-emissions.git/commitdiff
commands: display filename when creating waveforms in verbose mode
authorFrédéric Péters <fpeters@0d.be>
Wed, 28 Jul 2021 07:34:05 +0000 (09:34 +0200)
committerFrédéric Péters <fpeters@0d.be>
Wed, 28 Jul 2021 07:36:32 +0000 (09:36 +0200)
emissions/management/commands/create-sound-waveforms.py

index 52e7324d2babf43ab633d2f4079c5815dbbffb2b..495be1379870ecffae4ba3acac1b6abae1bae77c 100644 (file)
@@ -93,6 +93,9 @@ class Command(BaseCommand):
         ]
         wave_array = subprocess.check_output(cmd)
         for filename, n_samples in (('waveform.json', 200), ('waveform-500.json', 500)):
+            file_path = soundfile.get_format_path(filename)
+            if self.verbose:
+                print('creating', file_path)
             # reduce to $n_samples$ samples of max positive value
             if six.PY3:
                 wave_reduced = [
@@ -104,5 +107,4 @@ class Command(BaseCommand):
                     max(x)
                     for x in np.array_split(np.array([max(0, ord(x) - 128) for x in wave_array]), n_samples)
                 ]
-            file_path = soundfile.get_format_path(filename)
             json.dump(wave_reduced, open(file_path, 'w'))