Encoding speech utterances in flac (discontinuous chunks problem)

Alex K anxioz at yahoo.com
Tue Feb 28 12:17:06 PST 2012


Thank you for the response Stefan! 

>>> What extactly are you doing in the vader-start/stop signal handlers? 
In the vader start callback I am not doing anything right now. 
In the vader stop callback I write the buffered result to a file. Like I said before I have a callback for the fakesink 'handoff' signal, where I append the result to my buffer. 
It looks something like this

def vader_start(self, arg, data):
    print "Vader start"

def sink_new_buffer(self, pad, buffer, data):
   print "New Buffer!"
   self.sinkbuffer += buffer.data

def vader_stop(self, arg, data):
    print "Vader stop"
    FILE = open("out.flac", "wb")
    FILE.write(self.sinkbuffer)
    FILE.close()
    self.sinkbuffer = ""


>>> You might need to mark the first buffer of each new utterance with a
    discont flag.
The vader plugin emits VADER_START and VADER_STOP signals. How do I mark it with a discount flag? Also will that flag make the AudioEncoderClass to reset the element? 


>>> Use a smaller buffersize on the capture size or write your own chunking element. There is also a "removesilence" element and a "cutter" element which you might want to check
I looked at flac encoder's implementation and it seems that I can achieve my goal if I can invoke the GStAudioEncoderClass->stop and GstAudioEncoderClass start methods. This will basically reset the state of the flacencoder element. 
These methods are invoked by AudioEncoder element's gst_audio_encoder_activate method. 
However it seems like this method is invoked only when the pipeline is first started. 
Does anyone know if there is any other way I can trigger the method?

Thank you in advance,
Alex. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120228/ed19ad3b/attachment.htm>


More information about the gstreamer-devel mailing list