From: Guillaume Pellerin Date: Thu, 10 Oct 2013 08:08:50 +0000 (+0200) Subject: import all modules, fix exmaples, update version parsing X-Git-Tag: 0.5.0~43 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=d5994e6959fb65d7f9c0705bcf098354e1a732b1;p=timeside.git import all modules, fix exmaples, update version parsing --- diff --git a/README.rst b/README.rst index 433ec1b..6dfbfb3 100644 --- a/README.rst +++ b/README.rst @@ -132,10 +132,10 @@ Dive in Define some processors:: >>> import timeside - >>> decoder = timeside.decoder.FileDecoder('source.wav') + >>> decoder = timeside.decoder.FileDecoder('sweep.wav') >>> grapher = timeside.grapher.Waveform() - >>> analyzer = timeside.analyzer.MaxLevel() - >>> encoder = timeside.encoder.Mp3Encoder('output.mp3') + >>> analyzer = timeside.analyzer.Level() + >>> encoder = timeside.encoder.VorbisEncoder('sweep.ogg') then, the *magic* pipeline:: @@ -143,10 +143,8 @@ then, the *magic* pipeline:: get the results:: - >>> grapher.render(output='image.png') - >>> print 'Level:', analyzer.result() - -and finally see image.png and play output.mp3 ;) + >>> grapher.render(output='waveform.png') + >>> print 'Level:', analyzer.results() `More examples `_ diff --git a/tests/api/test_analyzer3.py b/tests/api/test_analyzer3.py index 8114723..f029392 100644 --- a/tests/api/test_analyzer3.py +++ b/tests/api/test_analyzer3.py @@ -9,10 +9,10 @@ import time class TestAnalyzer: - analyzer = timeside.analyzer.MaxLevel() + analyzer = timeside.analyzer.Level() def __init__(self, path): - self.source = os.path.join(os.path.dirname(__file__), path) + self.source = path print "Processing %s" % self.source self.decoder = timeside.decoder.FileDecoder(self.source) print 'format: ', self.decoder.format() diff --git a/timeside/__init__.py b/timeside/__init__.py index 11cb896..cd19602 100644 --- a/timeside/__init__.py +++ b/timeside/__init__.py @@ -2,5 +2,9 @@ import api import core +import decoder +import analyzer +import grapher +import encoder __version__ = '0.5.0' diff --git a/timeside/analyzer/core.py b/timeside/analyzer/core.py index 2fc9497..722a3d3 100644 --- a/timeside/analyzer/core.py +++ b/timeside/analyzer/core.py @@ -25,7 +25,7 @@ from utils import downsample_blocking from timeside.core import Processor, implements, interfacedoc from timeside.api import IAnalyzer -from timeside import __version__ as TimeSideVersion +from timeside.__init__ import __version__ import numpy from collections import OrderedDict @@ -877,7 +877,7 @@ class Analyzer(Processor): # Automatically write known metadata result.idMetadata = IdMetadata( date=datetime.now().replace(microsecond=0).isoformat(' '), - version=TimeSideVersion, + version=__version__, author='TimeSide') result.audioMetadata = AudioMetadata(uri=self.mediainfo()['uri'], start=self.mediainfo()['start'],