GST_APPSINK_MAX_BUFFERS = 10
QUEUE_SIZE = 10
+# TODO:
+# check if a soundcard device is available
+# alsasrc = gst.element_factory_make("alsasrc", "alsasrc")
+# alsasrc.probe_get_values_name('device')
+# ['hw:0,0']
+
class LiveDecoder(FileDecoder):
"""Live source Decoder based on Gstreamer
>>> mp3_encoder = timeside.encoder.mp3.Mp3Encoder('/tmp/test_live.mp3',
... overwrite=True)
>>> pipe = (live_decoder | waveform | mp3_encoder)
- >>> pipe.run()
+ >>> 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
from timeside.encoder.core import GstEncoder
from timeside.api import IEncoder
+# TODO:
+# check if a soundcard device is available
+# alsasink = gst.element_factory_make("alsasink", "alsasink")
+# alsasink.probe_get_values_name('device')
+# ['hw:0,0', 'hw:0,3', 'hw:0,7', 'hw:0,8']
+
+
class AudioSink(GstEncoder):
>>> wav_file = samples['sine440Hz_mono_1s.wav']
>>> d = get_processor('file_decoder')(wav_file)
>>> e = get_processor('live_encoder')()
- >>> (d|e).run()
+ >>> (d|e).run() # doctest: +SKIP
"""
implements(IEncoder)