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::
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>`_
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()
import api
import core
+import decoder
+import analyzer
+import grapher
+import encoder
__version__ = '0.5.0'
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
# 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'],