]> git.0d.be Git - django-panik-emissions.git/commitdiff
use generated soundfile to extract wave form
authorFrédéric Péters <fpeters@0d.be>
Thu, 10 Aug 2017 13:44:09 +0000 (15:44 +0200)
committerFrédéric Péters <fpeters@0d.be>
Thu, 10 Aug 2017 13:44:57 +0000 (15:44 +0200)
emissions/management/commands/create-sound-waveforms.py

index fca6fc3133629b5917005b9d816e9602003e19b2..a464e7474b07f8283076f6f594f8d307e73fd29a 100644 (file)
@@ -47,7 +47,7 @@ class Command(BaseCommand):
     def create(self, soundfile):
         file_path = soundfile.get_format_path('waveform.json')
         # create a raw output, with a single channel and 4000Hz samples of 8bits
-        cmd = ['sox', soundfile.file.path, '-t', 'raw', '-c', '1', '-r', '4000',
+        cmd = ['sox', soundfile.get_format_path('ogg'), '-t', 'raw', '-c', '1', '-r', '4000',
                 '-e' 'unsigned-integer', '-b', '8', '-']
         wave_array = subprocess.check_output(cmd)
         # reduce to 200 samples of max positive value