**aubio** is a tool designed for the extraction of annotations from audio signals. Its features include segmenting a sound file before each of its attacks, performing pitch detection, tapping the beat and producing midi streams from live audio.
See http://aubio.org/
+
Aubio Melenergy
---------------
-.. automodule:: timeside.analyzer.aubio_melenergy
+.. automodule:: timeside.analyzer.aubio.aubio_melenergy
:members:
:undoc-members:
:show-inheritance:
aubio_mfcc
----------
-.. automodule:: timeside.analyzer.aubio_mfcc
+.. automodule:: timeside.analyzer.aubio.aubio_mfcc
:members:
:undoc-members:
:show-inheritance:
aubio_pitch
-----------
-.. automodule:: timeside.analyzer.aubio_pitch
+.. automodule:: timeside.analyzer.aubio.aubio_pitch
:members:
:undoc-members:
:show-inheritance:
aubio_specdesc
--------------
-.. automodule:: timeside.analyzer.aubio_specdesc
+.. automodule:: timeside.analyzer.aubio.aubio_specdesc
:members:
:undoc-members:
:show-inheritance:
aubio_temporal
--------------
-.. automodule:: timeside.analyzer.aubio_temporal
+.. automodule:: timeside.analyzer.aubio.aubio_temporal
:members:
:undoc-members:
:show-inheritance:
File Decoder
===========
-.. autoclass:: FileDecoder
+.. autoclass:: timeside.decoder.file.FileDecoder
:members:
:undoc-members:
:show-inheritance:
Array Decoder
=============
-.. autoclass:: ArrayDecoder
+.. autoclass:: timeside.decoder.array.ArrayDecoder
:members:
:undoc-members:
:show-inheritance:
Live Decoder
=============
-.. autoclass:: LiveDecoder
+.. autoclass:: timeside.decoder.live.LiveDecoder
:members:
:undoc-members:
:show-inheritance:
First, let's import everything and define the audio file source :
>>> import timeside
+>>> from timeside.core import get_processor
>>> import numpy as np
>>> audio_file = 'http://github.com/yomguy/timeside-samples/raw/master/samples/sweep.mp3'
Then let's setup a :class:`FileDecoder <timeside.decoder.file.FileDecoder>` with argument `stack=True` (default argument is `stack=False`) :
->>> decoder = timeside.decoder.FileDecoder(audio_file, stack=True)
+>>> decoder = timeside.decoder.file.FileDecoder(audio_file, stack=True)
Setup an arbitrary analyzer to check that decoding process from file and from stack are equivalent:
->>> pitch_on_file = timeside.analyzer.AubioPitch()
+>>> pitch_on_file = get_processor('aubio_pitch')()
>>> pipe = (decoder | pitch_on_file)
>>> print pipe.processors #doctest: +ELLIPSIS
-[<timeside.decoder.file.FileDecoder object at 0x...>, <timeside.analyzer.aubio_pitch.AubioPitch object at 0x...>]
+[<timeside.decoder.file.FileDecoder object at 0x...>, <timeside.analyzer.aubio.aubio_pitch.AubioPitch object at 0x...>]
After the pipe has been run, the other processes of the pipe are removed from the pipe and only the :class:`FileDecoder <timeside.decoder.file.FileDecoder>` is kept :
If the pipe is used for a second run, the processed frames stored in the stack are passed to the other processors without decoding the audio source again.
Let's define a second analyzer equivalent to the previous one:
->>> pitch_on_stack = timeside.analyzer.AubioPitch()
+>>> pitch_on_stack = get_processor('aubio_pitch')()
Add it to the pipe:
>>> pipe |= pitch_on_stack
>>> print pipe.processors #doctest: +ELLIPSIS
-[<timeside.decoder.file.FileDecoder object at 0x...>, <timeside.analyzer.aubio_pitch.AubioPitch object at 0x...>]
+[<timeside.decoder.file.FileDecoder object at 0x...>, <timeside.analyzer.aubio.aubio_pitch.AubioPitch object at 0x...>]
And run the pipe:
import os
ModulePath = os.path.dirname(os.path.realpath(timeside.analyzer.core.__file__))
wavFile = os.path.join(ModulePath , '../../tests/samples/sweep.wav')
- decoder = timeside.decoder.FileDecoder(wavFile)
+ decoder = timeside.decoder.file.FileDecoder(wavFile)
.. testcleanup:: test_1
.. doctest:: test_1
- >>> import timeside # doctest: +SKIP
- >>> decoder = timeside.decoder.FileDecoder('sweep.wav')# doctest: +SKIP
- >>> encoder = timeside.encoder.VorbisEncoder('sweep.ogg')
+ >>> import timeside
+ >>> from timeside.core import get_processor
+ >>> decoder = get_processor('gst_dec')('sweep.wav')# doctest: +SKIP
+ >>> encoder = get_processor('gst_vorbis_enc')('sweep.ogg')
>>> pipe = decoder | encoder
>>> pipe.run()
.. doctest:: test_2
>>> import timeside
- >>> decoder = timeside.decoder.FileDecoder('sweep.wav') # doctest: +SKIP
- >>> spectrogram = timeside.grapher.SpectrogramLinear(width=400, height=150)
+ >>> from timeside.core import get_processor
+ >>> decoder = get_processor('gst-dec')('sweep.wav') # doctest: +SKIP
+ >>> spectrogram = get_processor('spectrogram_lin')(width=400, height=150)
>>> (decoder | spectrogram).run()
>>> spectrogram.render('graph.png')
.. doctest:: test_3
>>> import timeside
- >>> decoder = timeside.decoder.FileDecoder('sweep.wav') # doctest: +SKIP
- >>> levels = timeside.analyzer.Level()
- >>> encoders = timeside.encoder.Mp3Encoder('sweep.mp3') | timeside.encoder.FlacEncoder('sweep.flac')
+ >>> from timeside.core import get_processor
+ >>> decoder = get_processor('gst-dec')('sweep.wav') # doctest: +SKIP
+ >>> levels = get_processor('level')()
+ >>> encoders = get_processor('gst_mp3_enc')('sweep.mp3') | get_processor('gst_flac_enc')('sweep.flac')
>>> (decoder | levels | encoders).run()
>>> print levels.results
{'level.max': GlobalValueResult(id_metadata=IdMetadata(id='level.max', name='Level Max', unit='dBFS', description='', date='...', version='...', author='TimeSide', uuid='...'), data_object=DataObject(value=array([-6.021])), audio_metadata=AudioMetadata(uri='file://...sweep.wav', start=0.0, duration=8.0, is_segment=False, sha1='...', channels=2, channelsManagement=''), parameters={}), 'level.rms': GlobalValueResult(id_metadata=IdMetadata(id='level.rms', name='Level RMS', unit='dBFS', description='', date='...', version='...', author='TimeSide', uuid='...'), data_object=DataObject(value=array([-9.856])), audio_metadata=AudioMetadata(uri='file://...sweep.wav', start=0.0, duration=8.0, is_segment=False, sha1='...', channels=2, channelsManagement=''), parameters={})}
class Yaafe(Analyzer):
-
"""Yaafe feature extraction library interface analyzer"""
implements(IAnalyzer)
>>> import timeside
+ >>> from timeside.core import get_processor
>>> live = timeside.decoder.live.LiveDecoder(num_buffers=5)
- >>> a = timeside.analyzer.Waveform()
+ >>> a = get_processor('waveform_analyzer')()
>>> e = timeside.encoder.mp3.Mp3Encoder('/tmp/test_live.mp3',
... overwrite=True)
>>> pipe = (live | a | e)