From c8ea143a3f61661e83863b35267d34608b4e2ddb Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Wed, 16 Oct 2013 01:15:18 +0200 Subject: [PATCH] update wavform batch --- scripts/timeside-waveforms | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/timeside-waveforms b/scripts/timeside-waveforms index 55f55eb..4799f77 100755 --- a/scripts/timeside-waveforms +++ b/scripts/timeside-waveforms @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright (c) 2009-2010 Guillaume Pellerin +# Copyright (c) 2009-2013 Guillaume Pellerin # This file is part of TimeSide. @@ -20,7 +20,7 @@ # Author: Guillaume Pellerin -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: -- 2.39.5