class_docstr: Live source Decoder based on Gstreamer
  capturing audio from alsasrc
  
   Construct a new LiveDecoder capturing audio from alsasrc
  
   Parameters
   ----------
   num_buffers : int, optional
       Number of buffers to output before sending End Of Stream signal
       (-1 = unlimited).
       (Allowed values: >= -1, Default value: -1)
  
   input_src : str, optional
       Gstreamer source element
       default to 'alsasrc'
       possible values :  'autoaudiosrc', 'alsasrc', 'osssrc'
  
   Examples
   --------
  
   # >>> import timeside
  
   # >>> from timeside.core import get_processor
   # >>> live_decoder = get_processor('live_decoder')(num_buffers=5)
   # >>> waveform = get_processor('waveform_analyzer')()
   # >>> mp3_encoder = timeside.plugins.encoder.mp3.Mp3Encoder('/tmp/test_live.mp3',
   # ...                                               overwrite=True)
   # >>> pipe = (live_decoder | waveform | mp3_encoder)
   # >>> pipe.run()  # doctest: +SKIP
   # >>> # Show the audio as captured by the decoder
   # >>> import matplotlib.pyplot as plt # doctest: +SKIP
   # >>> plt.plot(a.results['waveform_analyzer'].time, # doctest: +SKIP
   #          a.results['waveform_analyzer'].data) # doctest: +SKIP
   # >>> plt.show() # doctest: +SKIP
  
   
class_docstr_tok: ["Live","source","Decoder","based","on","Gstreamer","capturing","audio","from","alsasrc","Construct","a","new","LiveDecoder","capturing","audio","from","alsasrc","Parameters","--","--","--","--","--","num_buffers",":","int",",","optional","Number","of","buffers","to","output","before","sending","End","Of","Stream","signal","(","-1","=","unlimited",")",".","(","Allowed","values",":",">","=","-1",",","Default","value",":","-1",")","input_src",":","str",",","optional","Gstreamer","source","element","default","to","'alsasrc'","possible","values",":","'autoaudiosrc","'",",","'alsasrc","'",",","'osssrc'","Examples","--","--","--","--","#",">",">",">","import","timeside","#",">",">",">","from","timeside.core","import","get_processor","#",">",">",">","live_decoder","=","get_processor","(","'live_decoder","'",")","(","num_buffers=5",")","#",">",">",">","waveform","=","get_processor","(","'waveform_analyzer","'",")","(",")","#",">",">",">","mp3_encoder","=","timeside.plugins.encoder.mp3.Mp3Encoder","(","'\/tmp\/test_live.mp3","'",",","#","...","overwrite=True",")","#",">",">",">","pipe","=","(","live_decoder","|","waveform","|","mp3_encoder",")","#",">",">",">","pipe.run","(",")","#","doctest",":","+SKIP","#",">",">",">","#","Show","the","audio","as","captured","by","the","decoder","#",">",">",">","import","matplotlib.pyplot","as","plt","#","doctest",":","+SKIP","#",">",">",">","plt.plot","(","a.results","[","'waveform_analyzer","'","]",".time",",","#","doctest",":","+SKIP","#","a.results","[","'waveform_analyzer","'","]",".data",")","#","doctest",":","+SKIP","#",">",">",">","plt.show","(",")","#","doctest",":","+SKIP"]
code: def __init__(self, num_buffers=-1, input_src="alsasrc"):
      super(Decoder, self).__init__()
      self.num_buffers = num_buffers
      self.uri = None
      self.uri_start = 0
      self.uri_duration = None
      self.is_segment = False
      self.input_src = input_src
      self._sha1 = ""
  
file_path: TimeSide/timeside/plugins/decoder/live.py
imports: from __future__ import division
  from timeside.core.decoder import Decoder, IDecoder, interfacedoc, implements
  from timeside.core.tools.gstutils import MainloopThread, GLib, Gst
  import threading
label_desc: Use image node_id 3 to create a new LiveDecoder object  with example: obj = LiveDecoder(num_buffers, input_src)