From f162de97581f57dbfd3f273f6c489da758f41765 Mon Sep 17 00:00:00 2001 From: yomguy Date: Thu, 7 Oct 2010 22:11:18 +0000 Subject: [PATCH] fix joydiv antialiasing, fix uri for decoder --- timeside/__init__.py | 4 ---- timeside/decoder/core.py | 2 +- timeside/grapher/waveform_joydiv.py | 6 +++--- timeside/tests/api/test_analyzer.py | 8 ++++---- timeside/tools/waveform_batch.py | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/timeside/__init__.py b/timeside/__init__.py index 4d760f6..88a5c7c 100644 --- a/timeside/__init__.py +++ b/timeside/__init__.py @@ -10,7 +10,3 @@ import timeside.encoder import timeside.grapher import timeside.analyzer from timeside.core import * - - - - diff --git a/timeside/decoder/core.py b/timeside/decoder/core.py index 1c6f11d..b66d13b 100644 --- a/timeside/decoder/core.py +++ b/timeside/decoder/core.py @@ -56,7 +56,7 @@ class FileDecoder(Processor): def setup(self, channels = None, samplerate = None, nframes = None): # the output data format we want caps = "audio/x-raw-float, width=32" - pipeline = gst.parse_launch('''uridecodebin uri=%s + pipeline = gst.parse_launch('''uridecodebin uri="%s" ! audioconvert ! %s ! appsink name=sink sync=False ''' % (self.uri, caps)) diff --git a/timeside/grapher/waveform_joydiv.py b/timeside/grapher/waveform_joydiv.py index 5de1a34..5bd65cf 100644 --- a/timeside/grapher/waveform_joydiv.py +++ b/timeside/grapher/waveform_joydiv.py @@ -98,12 +98,12 @@ class WaveformImageJoyContour(WaveformImage): if not x == 0: if not self.symetry: self.draw.line([self.previous_x, self.previous_y, x, y], line_color) - #self.draw_anti_aliased_pixels(x, y, y, line_color) + self.draw_anti_aliased_pixels(x, y, y, line_color) else: self.draw.line([self.previous_x, self.previous_y+height, x, y+height], line_color) - #self.draw_anti_aliased_pixels(x, y+height, y+height, line_color) + self.draw_anti_aliased_pixels(x, y+height, y+height, line_color) self.draw.line([self.previous_x, -self.previous_y+height, x, -y+height], line_color) - #self.draw_anti_aliased_pixels(x, -y+height, -y+height, line_color) + self.draw_anti_aliased_pixels(x, -y+height, -y+height, line_color) else: if not self.symetry: self.draw.point((x, y), line_color) diff --git a/timeside/tests/api/test_analyzer.py b/timeside/tests/api/test_analyzer.py index 1ef11ea..2b8198d 100644 --- a/timeside/tests/api/test_analyzer.py +++ b/timeside/tests/api/test_analyzer.py @@ -7,12 +7,12 @@ import numpy class TestAnalyzer: - + graphers = timeside.core.processors(timeside.api.IGrapher) decoders = timeside.core.processors(timeside.api.IDecoder) encoders= timeside.core.processors(timeside.api.IEncoder) analyzers = timeside.core.processors(timeside.api.IAnalyzer) - + def __init__(self, path): self.source = os.path.join(os.path.dirname(__file__), path) print "Processing %s" % self.source @@ -27,7 +27,7 @@ class TestAnalyzer: self.analyzers_sub_pipe.append(sub_pipe) self.pipe = self.pipe | sub_pipe self.pipe.run() - + def results(self): analyzers = [] for analyzer in self.analyzers_sub_pipe: @@ -40,7 +40,7 @@ class TestAnalyzer: test = TestAnalyzer('../samples/guitar.wav') -#test = TestAnalyzer('/mnt/data4/Music1/Cellar_playlist_tmp/JanoB/VirulentAcidMix.wav') +#test = TestAnalyzer('/home/momo/music/wav/Cellar/Cellar-FinallyMix_01.wav') test.process() test.results() diff --git a/timeside/tools/waveform_batch.py b/timeside/tools/waveform_batch.py index b0c2208..b46d6d5 100644 --- a/timeside/tools/waveform_batch.py +++ b/timeside/tools/waveform_batch.py @@ -45,7 +45,7 @@ class GrapherScheme: self.height = 96 # Background color - self.bg_color = (136,136,136) + self.bg_color = (0,0,0) # Force computation. By default, the class doesn't overwrite existing image files. self.force = True -- 2.39.5