From f58140a1d0810458a2d465173e6776a190dc9f4d Mon Sep 17 00:00:00 2001 From: yomguy Date: Fri, 18 Mar 2011 17:01:59 +0000 Subject: [PATCH] test with blocksize --- timeside/decoder/core.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/timeside/decoder/core.py b/timeside/decoder/core.py index 66540b0..481b9cf 100644 --- a/timeside/decoder/core.py +++ b/timeside/decoder/core.py @@ -25,6 +25,7 @@ from timeside.core import Processor, implements, interfacedoc from timeside.api import IDecoder from numpy import array, frombuffer, getbuffer, float32 +import Queue import pygst pygst.require('0.10') @@ -44,7 +45,8 @@ class FileDecoder(Processor): audiorate = None audionframes = None mimetype = '' - + buffer_size = 0x2000 + # IProcessor methods @staticmethod @@ -53,9 +55,11 @@ class FileDecoder(Processor): return "gstreamerdec" def setup(self, channels = None, samplerate = None, nframes = None): + self.queue = Queue.Queue(self.buffer_size) + # the output data format we want caps = "audio/x-raw-float, width=32" - self.pipeline = gst.parse_launch('''uridecodebin uri="%s" + self.pipeline = gst.parse_launch('''uridecodebin uri="%s" ! audioconvert ! %s ! appsink name=sink sync=False ''' % (self.uri, caps)) @@ -63,7 +67,7 @@ class FileDecoder(Processor): self.sink = self.pipeline.get_by_name('sink') self.sink.set_property('emit-signals', True) # adjust length of emitted buffers - self.sink.set_property('blocksize', 0x8000) + self.sink.set_property('blocksize', 16384) # start pipeline self.pipeline.set_state(gst.STATE_PLAYING) -- 2.39.5