============
python (>= 2.4), python-xml, python-mutagen, python-imaging (>= 1.1.6),
-python-numpy, python-setuptools (>= 0.6b3), libsndfile1 (>= 1.0.17),
-python-gst0.10, gstreamer0.10-plugins-base
+python-numpy, python-setuptools (>= 0.6b3), libsndfile1 (>= 1.0.17),
+python-gst0.10, gstreamer0.10-plugins-base, gstreamer0.10-plugins-fluendo-mp3,
+gstreamer0.10-plugins-good
License
=======
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
'''The setup and build script for the python-twitter library.'''
# -*- coding: utf-8 -*-
-from core import *
-from metadata import Metadata
-import decoder
-import encoder
-import grapher
-import analyzer
+
+import timeside.exceptions
+import timeside.core
+import timeside.component
+import timeside.metadata
+import timeside.decoder
+import timeside.encoder
+import timeside.grapher
+import timeside.analyzer
+
# -*- coding: utf-8 -*-
-from timeside.analyzer.core import *
-from timeside.analyzer.duration import *
-from timeside.analyzer.max_level import *
+
+from core import *
+from duration import *
+from max_level import *
+
#from timeside.analyzer.mean_level import *
#from timeside.analyzer.dc import *
# -*- coding: utf-8 -*-
-from timeside.decoder.core import *
+import timeside.core
+from core import *
! audioconvert
! %s
! appsink name=sink sync=False ''' % (self.uri, caps))
- # store a pointer to appsink in our decoder object
+ # store a pointer to appsink in our decoder object
self.sink = pipeline.get_by_name('sink')
# adjust length of emitted buffers
# self.sink.set_property('blocksize', 0x10000)
@interfacedoc
def samplerate(self):
- return self.audiorate
+ return self.audiorate
@interfacedoc
def nframes(self):
@interfacedoc
def release(self):
- # nothing to do for now
+ # nothing to do for now
pass
## IDecoder methods
@interfacedoc
def __init__(self, uri):
- # is this a file?
+ # is this a file?
import os.path
if os.path.exists(uri):
# get the absolute path
# and make a uri of it
from urllib import quote
self.uri = 'file://'+quote(uri)
+ else:
+ self.uri = uri
@interfacedoc
def format(self):
@interfacedoc
def resolution(self):
# TODO check: width or depth?
- return self.audiowidth
+ return self.audiowidth
@interfacedoc
def metadata(self):
self.mimetype= d.mimetype
self.audiochannels = d.audiochannels
self.audiowidth = d.audiowidth
- # conversion from time in nanoseconds to frames
+ # conversion from time in nanoseconds to frames
from math import ceil
duration = d.audiorate * d.audiolength * 1.e-9
self.audionframes = int (ceil ( duration ) )
def gst_buffer_to_numpy_array(self, buf):
""" gstreamer buffer to numpy array conversion """
chan = self.audiochannels
- samples = frombuffer(buf.data, dtype=float32)
+ samples = frombuffer(buf.data, dtype=float32)
samples.resize([len(samples)/chan, chan])
return samples
# -*- coding: utf-8 -*-
-from timeside.encoder.core import *
+from core import *
#from timeside.encoder.ogg import *
-from timeside.encoder.wav import *
+from wav import *
#from timeside.encoder.mp3 import *
#from timeside.encoder.flac import *
# -*- coding: utf-8 -*-
-from timeside.grapher.core import *
-from timeside.grapher.waveform import *
-from timeside.grapher.spectrogram import *
+from core import *
+from waveform import *
+from spectrogram import *
import os
import sys
-from timeside.core import *
-from timeside.decoder import *
-from timeside.grapher import *
-
+import timeside
class GrapherScheme:
if not os.path.exists(image) or self.force:
print 'Rendering ', source, ' to ', image, '...'
audio = os.path.join(os.path.dirname(__file__), source)
- decoder = FileDecoder(audio)
- waveform = Waveform(width=self.width, height=self.height, output=image,
+ decoder = timeside.decoder.FileDecoder(audio)
+ waveform = timeside.grapher.Waveform(width=self.width, height=self.height, output=image,
bg_color=self.bg_color, color_scheme=self.color_scheme)
(decoder | waveform).run()
print 'frames per pixel = ', waveform.graph.samples_per_pixel