]> git.parisson.com Git - timeside.git/commitdiff
update wavform batch
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 15 Oct 2013 23:15:18 +0000 (01:15 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 15 Oct 2013 23:15:18 +0000 (01:15 +0200)
scripts/timeside-waveforms

index 55f55ebcd887715ab5307c58d178634598c8842e..4799f7783497cd15fb9ee452be65a494f7d62cc0 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # -*- coding: utf-8 -*-
 #
-# Copyright (c) 2009-2010 Guillaume Pellerin <yomguy@parisson.com>
+# Copyright (c) 2009-2013 Guillaume Pellerin <yomguy@parisson.com>
 
 # This file is part of TimeSide.
 
@@ -20,7 +20,7 @@
 
 # Author: Guillaume Pellerin <yomguy@parisson.com>
 
-version = '0.3'
+version = '0.4'
 
 import os
 import sys
@@ -34,7 +34,7 @@ class GrapherScheme:
         self.color_scheme = {
             'waveform': [
             # Four (R,G,B) tuples for three main color channels for the spectral centroid method
-                        (30,144,255), (30,144,255), (30,144,255), (30,144,255)
+                        (0,0,255), (0,255,255), (255,255,0), (255,0,0)
                         ],
             'spectrogram': [
                         (0, 0, 0), (58/4,68/4,65/4), (80/2,100/2,153/2),
@@ -97,12 +97,10 @@ class Media2Waveform(object):
                 print 'Processing ', source
                 audio = os.path.join(os.path.dirname(__file__), source)
                 decoder  = timeside.decoder.FileDecoder(audio)
-                duration = decoder.duration
                 (decoder | waveform).run()
                 img_name = os.path.split(image)[1]
                 image = os.path.split(image)[0]+os.sep+os.path.splitext(img_name)[0] + '_' +\
-                        '_'.join([str(self.width),  str(self.height),
-                                  str(int(duration))])+os.path.splitext(img_name)[1]
+                        '_'.join([str(self.width),  str(self.height)])+os.path.splitext(img_name)[1]
                 waveform.graph.filename = image
                 print 'Rendering ', waveform.graph.filename
                 #print 'frames per pixel = ', waveform.graph.samples_per_pixel
@@ -114,8 +112,8 @@ if __name__ == '__main__':
         print """
  timeside-waveforms : TimeSide simple batch waveform generator
 
- usage      : ./timeside-waveforms /path/to/media_dir /path/to/img_dir
- infos      : http://code.google.com/p/timeside/
+ usage      : timeside-waveforms /path/to/media_dir /path/to/img_dir
+ infos      : https://github.com/yomguy/TimeSide/
  version    : %s
         """ % version
     else: