]> git.parisson.com Git - timeside.git/commitdiff
Minor changes in live and file decoder and audiosink encoder
authorThomas Fillon <thomas@parisson.com>
Mon, 20 Jan 2014 08:42:45 +0000 (09:42 +0100)
committerThomas Fillon <thomas@parisson.com>
Mon, 20 Jan 2014 08:42:45 +0000 (09:42 +0100)
timeside/decoder/file.py
timeside/decoder/live.py
timeside/encoder/audiosink.py

index 389a7074fb2d90571da2daf0c46079aa1a106bfb..8d012a376127e28216b6677cf56bf4738f0a73e4 100644 (file)
@@ -111,7 +111,7 @@ class FileDecoder(Decoder):
 
         if self.is_segment:
             # Create the pipe with Gnonlin gnlurisource
-            self.pipe = ''' gnlurisource uri={uri}
+            self.pipe = ''' gnlurisource name=src uri={uri}
                             start=0
                             duration={uri_duration}
                             media-start={uri_start}
@@ -125,7 +125,7 @@ class FileDecoder(Decoder):
                                        # convert uri_start and uri_duration to nanoseconds
         else:
             # Create the pipe with standard Gstreamer uridecodbin
-            self.pipe = ''' uridecodebin name=uridecodebin uri={uri}
+            self.pipe = ''' uridecodebin name=src uri={uri}
                            ! audioconvert name=audioconvert
                            ! audioresample
                            ! appsink name=sink sync=False async=True
@@ -147,6 +147,7 @@ class FileDecoder(Decoder):
             width=(int)32,
             rate=(int)%s""" % (caps_channels, caps_samplerate))
 
+        self.src = self.pipeline.get_by_name('src')
         self.conv = self.pipeline.get_by_name('audioconvert')
         self.conv.get_pad("sink").connect("notify::caps", self._notify_caps_cb)
 
index 4c7e5c65a7db00d3de9028ec03f25226b0505d7f..539575ff7193bce4703534c6a70ed0a9cd1e70b3 100644 (file)
@@ -62,11 +62,12 @@ class LiveDecoder(Decoder):
 
         >>> import timeside
 
-        >>> live = timeside.decoder.LiveDecoder(num_buffers=25)
+        >>> live = timeside.decoder.LiveDecoder(num_buffers=5)
         >>> a = timeside.analyzer.Waveform()
-        >>> e = timeside.encoder.Mp3Encoder('test_live.mp3', overwrite=True)
+        >>> e = timeside.encoder.Mp3Encoder('/tmp/test_live.mp3',
+        ...                                 overwrite=True)
         >>> pipe = (live | a | e)
-        >>> pipe.run()
+        >>> pipe.run() # doctest: +SKIP
 
         >>> import matplotlib.pyplot as plt # doctest: +SKIP
         >>> plt.plot(a.results['waveform_analyzer'].time, # doctest: +SKIP
index f60d1284e1ba2fbee350e38e1369964e45b20620..9372ce6d2d17a82608341ef6a676f2fc1f9c0ea8 100644 (file)
@@ -25,7 +25,6 @@ from timeside.encoder.core import GstEncoder
 from timeside.api import IEncoder
 from timeside.tools import *
 
-
 class AudioSink(GstEncoder):
     """
     gstreamer-based Audio Sink
@@ -43,8 +42,7 @@ class AudioSink(GstEncoder):
     implements(IEncoder)
 
     def __init__(self, output_sink='autoaudiosink'):
-        """
-        """
+
         super(GstEncoder, self).__init__()
         self.streaming = False
 
@@ -100,4 +98,4 @@ class AudioSink(GstEncoder):
 
 if __name__ == "__main__":
     import doctest
-    doctest.testmod()
\ No newline at end of file
+    doctest.testmod()