]> git.parisson.com Git - timeside.git/commitdiff
import all modules, fix exmaples, update version parsing
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 10 Oct 2013 08:08:50 +0000 (10:08 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 10 Oct 2013 08:08:50 +0000 (10:08 +0200)
README.rst
tests/api/test_analyzer3.py
timeside/__init__.py
timeside/analyzer/core.py

index 433ec1b203d6089fea6d815b08ddcc5b8056a9f7..6dfbfb3147b5eb9bc82e54ea836b3593f95c2ac9 100644 (file)
@@ -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 <http://code.google.com/p/timeside/wiki/PythonApi>`_
 
index 8114723310997ee6855965200bf0cb0dae408dcd..f029392cc23302c3c92c78d5975853802ae1f50c 100644 (file)
@@ -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()
index 11cb896bc0739f0af1a5c0dde3a90a983efbe36a..cd196024dda26edee49f02dca0085380ca3f10e8 100644 (file)
@@ -2,5 +2,9 @@
 
 import api
 import core
+import decoder
+import analyzer
+import grapher
+import encoder
 
 __version__ = '0.5.0'
index 2fc94975f3fc1f83dc06340fc064955a98b6284d..722a3d3d912a7ec585bfb5920787cf30a2acde3e 100644 (file)
@@ -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'],