fix getting waveform for mp3 soundfiles
authorFrédéric Péters <fpeters@0d.be>
Mon, 26 Jul 2021 11:57:06 +0000 (13:57 +0200)
committerFrédéric Péters <fpeters@0d.be>
Mon, 26 Jul 2021 11:57:06 +0000 (13:57 +0200)
panikweb_esperanzah/static/js/specifics.js

index 3f74e07..5f9a6ef 100644 (file)
@@ -443,7 +443,8 @@ $(function() {
                        var audio_src = $(audio).find('source')[0];
                        var sound_id = $(audio).data('sound-id');
                        var $waveform = $(audio).next();
-                       $.getJSON(audio_src.src.replace('.ogg', '.waveform.json'), function(data) {
+                       var waveform_url = audio_src.src.replace('.ogg', '.waveform.json').replace('.mp3', '.waveform.json');
+                       $.getJSON(waveform_url, function(data) {
                                $waveform.empty();
                                $waveform.append('<i class="duration">' + $waveform.data('duration-string') + '</i>');
                                $.each(data, function(k, val) {