Changeset - 522d7bf9b5b2
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 6 years ago 2019-06-09 04:46:46
drewp@bigasterisk.com
spectrograms work even when music is ogg files
Ignore-this: 7a3ae40d1f6a7d331839087ceeb45e99
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/web/timeline/light9-timeline-audio.html
Show inline comments
 
@@ -40,45 +40,45 @@
 
       },
 
       observers: [
 
           'setImgSrc(graph, show, song)'
 
       ],
 
       ready: function() {
 
           this.zoom = {duration: 0};
 
       },       
 
       setImgSrc: function() {
 
           graph.runHandler(function() {
 
               try {
 
                   var root = this.graph.stringValue(
 
                       this.graph.Uri(this.show),
 
                       this.graph.Uri(':spectrogramUrlRoot'));
 
               } catch(e) {
 
                   return;
 
               }
 
               
 
               try {
 
                   var filename = this.graph.stringValue(
 
                       this.song, this.graph.Uri(':songFilename'));
 
               } catch(e) {
 
                   return;
 
               }
 
               
 
               this.imgSrc = root + '/' + filename.replace('.wav', '.png');
 
               this.imgSrc = root + '/' + filename.replace('.wav', '.png').replace('.ogg', '.png');
 
           }.bind(this), "timeline-audio " + this.song);
 
       },
 
       _imgWidth: function(zoom) {
 
           if (!zoom.duration) {
 
               return "100%";
 
           }
 

	
 
           return (100 / ((zoom.t2 - zoom.t1) / zoom.duration)) + "%";
 
       },
 
       _imgLeft: function(zoom) {
 
           if (!zoom.duration) {
 
               return "0";
 
           }
 

	
 
           var percentPerSec = 100 / (zoom.t2 - zoom.t1);
 
           return (-percentPerSec * zoom.t1) + '%';
 
       },
 
   });
 
  </script>
 
</dom-module>
0 comments (0 inline, 0 general)