From: Guillaume Pellerin Date: Thu, 23 Oct 2014 10:35:24 +0000 (+0200) Subject: update some docstrings X-Git-Tag: 0.6~1^2~6^2~7 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=02f7fce955f43d86d99a90381182d49c67e07a89;p=timeside.git update some docstrings --- diff --git a/README.rst b/README.rst index 2fb9418..6758cf4 100644 --- a/README.rst +++ b/README.rst @@ -65,74 +65,75 @@ News For older news, please visit: https://github.com/yomguy/TimeSide/blob/master/NEWS.rst -IProcessor +Processors ========== + IEncoder -------- - * live_encoder : Gstreamer-based Audio Sink - * flac_encoder : FLAC encoder based on Gstreamer - * aac_encoder : AAC encoder based on Gstreamer - * mp3_encoder : MP3 encoder based on Gstreamer - * vorbis_encoder : OGG Vorbis encoder based on Gstreamer - * opus_encoder : Opus encoder based on Gstreamer - * wav_encoder : WAV encoder based on Gstreamer - * webm_encoder : WebM encoder based on Gstreamer + * **live_encoder** : Gstreamer-based Audio Sink + * **flac_encoder** : FLAC encoder based on Gstreamer + * **aac_encoder** : AAC encoder based on Gstreamer + * **mp3_encoder** : MP3 encoder based on Gstreamer + * **vorbis_encoder** : OGG Vorbis encoder based on Gstreamer + * **opus_encoder** : Opus encoder based on Gstreamer + * **wav_encoder** : WAV encoder based on Gstreamer + * **webm_encoder** : WebM encoder based on Gstreamer IDecoder -------- - * array_decoder : Decoder taking Numpy array as input - * file_decoder : File Decoder based on Gstreamer - * live_decoder : Live source Decoder based on Gstreamer + * **array_decoder** : Decoder taking Numpy array as input + * **file_decoder** : File Decoder based on Gstreamer + * **live_decoder** : Live source Decoder based on Gstreamer IGrapher -------- - * grapher_aubio_pitch : Builds a PIL image representing Aubio Pitch - * grapher_onset_detection_function : Builds a PIL image representing Onset detection function - * grapher_waveform : Builds a PIL image representing Waveform from Analyzer - * grapher_irit_speech_4hz_segments : Builds a PIL image representing Irit 4Hz Speech Segmentation - * grapher_irit_speech_4hz_segments_median : Builds a PIL image representing Irit 4Hz Speech Segmentation with median filter - * grapher_monopoly_segments : Builds a PIL image representing Irit Monopoly Segmentation - * grapher_limsi_sad_etape : Builds a PIL image representing LIMSI SAD with ETAPE model - * grapher_limsi_sad_maya : Builds a PIL image representing LIMSI SAD with Mayan model - * grapher_irit_startseg : Builds a PIL image representing IRIT Start Noise - * spectrogram_log : Builds a PIL image representing a spectrogram of the audio stream - * spectrogram_lin : Builds a PIL image representing a spectrogram of the audio stream (level vs. frequency vs. time). - * waveform_simple : Builds a PIL image representing a simple waveform of the audio stream. - * waveform_centroid : Builds a PIL image representing a waveform of the audio stream. - * waveform_contour_black : Builds a PIL image representing an amplitude coutour (envelop) of the audio stream. - * waveform_contour_white : Builds a PIL image representing an amplitude coutour (envelop) of the audio stream. - * waveform_transparent : Builds a PIL image representing a transparent waveform + * **grapher_aubio_pitch** : Builds a PIL image representing Aubio Pitch + * **grapher_onset_detection_function** : Builds a PIL image representing Onset detection function + * **grapher_waveform** : Builds a PIL image representing Waveform from Analyzer + * **grapher_irit_speech_4hz_segments** : Builds a PIL image representing Irit 4Hz Speech Segmentation + * **grapher_irit_speech_4hz_segments_median** : Builds a PIL image representing Irit 4Hz Speech Segmentation with median filter + * **grapher_monopoly_segments** : Builds a PIL image representing Irit Monopoly Segmentation + * **grapher_limsi_sad_etape** : Builds a PIL image representing LIMSI SAD with ETAPE model + * **grapher_limsi_sad_maya** : Builds a PIL image representing LIMSI SAD with Mayan model + * **grapher_irit_startseg** : Builds a PIL image representing IRIT Start Noise + * **spectrogram_log** : logarithmic scaled spectrogram (level vs. frequency vs. time). + * **spectrogram_lin** : Linear scaled spectrogram (level vs. frequency vs. time). + * **waveform_simple** : Simple monochrome waveform image. + * **waveform_centroid** : Waveform where peaks are colored relatively to the spectral centroids of each frame buffer. + * **waveform_contour_black** : Black amplitude contour waveform. + * **waveform_contour_white** : an white amplitude contour wavform. + * **waveform_transparent** : Transparent waveform. IAnalyzer --------- - * mean_dc_shift : Mean DC shift analyzer - * level : Audio level analyzer - * aubio_melenergy : Aubio Mel Energy analyzer - * aubio_mfcc : Aubio MFCC analyzer - * aubio_pitch : Aubio Pitch estimation analyzer - * aubio_specdesc : Aubio Spectral Descriptors collection analyzer - * aubio_temporal : Aubio Temporal analyzer - * yaafe : Yaafe feature extraction library interface analyzer - * irit_monopoly : Segmentor Monophony/Polyphony based on the analysis of yin confidence. - * irit_startseg : Segmentation of recording sessions into 'start' and 'session' segments - * irit_speech_4hz : Speech Segmentor based on the 4Hz energy modulation analysis. - * irit_speech_entropy : Speech Segmentor based on Entropy analysis. - * limsi_sad : Limsi Speech Activity Detection Systems - * spectrogram_analyzer : Spectrogram analyzer - * onset_detection_function : Onset Detection Function analyzer - * spectrogram_analyzer_2 : Spectrogram analyzer - * spectrogram_analyzer_3 : Spectrogram analyzer - * waveform_analyzer : Waveform analyzer + * **mean_dc_shift** : Mean DC shift analyzer + * **level** : Audio level analyzer + * **aubio_melenergy** : Aubio Mel Energy analyzer + * **aubio_mfcc** : Aubio MFCC analyzer + * **aubio_pitch** : Aubio Pitch estimation analyzer + * **aubio_specdesc** : Aubio Spectral Descriptors collection analyzer + * **aubio_temporal** : Aubio Temporal analyzer + * **yaafe** : Yaafe feature extraction library interface analyzer + * **irit_monopoly** : Segmentor Monophony/Polyphony based on the analysis of yin confidence. + * **irit_startseg** : Segmentation of recording sessions into 'start' and 'session' segments + * **irit_speech_4hz** : Speech Segmentor based on the 4Hz energy modulation analysis. + * **irit_speech_entropy** : Speech Segmentor based on Entropy analysis. + * **limsi_sad** : Limsi Speech Activity Detection Systems + * **spectrogram_analyzer** : Spectrogram analyzer + * **onset_detection_function** : Onset Detection Function analyzer + * **spectrogram_analyzer_2** : Spectrogram analyzer + * **spectrogram_analyzer_3** : Spectrogram analyzer + * **waveform_analyzer** : Waveform analyzer IEffect ------- - * fx_gain : Gain effect processor + * **fx_gain** : Gain effect processor Dive in diff --git a/doc/source/processors.rst b/doc/source/processors.rst index 220b64c..7904ebc 100644 --- a/doc/source/processors.rst +++ b/doc/source/processors.rst @@ -1,70 +1,71 @@ -IProcessor +Processors ========== + IEncoder -------- - * live_encoder : Gstreamer-based Audio Sink - * flac_encoder : FLAC encoder based on Gstreamer - * aac_encoder : AAC encoder based on Gstreamer - * mp3_encoder : MP3 encoder based on Gstreamer - * vorbis_encoder : OGG Vorbis encoder based on Gstreamer - * opus_encoder : Opus encoder based on Gstreamer - * wav_encoder : WAV encoder based on Gstreamer - * webm_encoder : WebM encoder based on Gstreamer + * **live_encoder** : Gstreamer-based Audio Sink + * **flac_encoder** : FLAC encoder based on Gstreamer + * **aac_encoder** : AAC encoder based on Gstreamer + * **mp3_encoder** : MP3 encoder based on Gstreamer + * **vorbis_encoder** : OGG Vorbis encoder based on Gstreamer + * **opus_encoder** : Opus encoder based on Gstreamer + * **wav_encoder** : WAV encoder based on Gstreamer + * **webm_encoder** : WebM encoder based on Gstreamer IDecoder -------- - * array_decoder : Decoder taking Numpy array as input - * file_decoder : File Decoder based on Gstreamer - * live_decoder : Live source Decoder based on Gstreamer + * **array_decoder** : Decoder taking Numpy array as input + * **file_decoder** : File Decoder based on Gstreamer + * **live_decoder** : Live source Decoder based on Gstreamer IGrapher -------- - * grapher_aubio_pitch : Builds a PIL image representing Aubio Pitch - * grapher_onset_detection_function : Builds a PIL image representing Onset detection function - * grapher_waveform : Builds a PIL image representing Waveform from Analyzer - * grapher_irit_speech_4hz_segments : Builds a PIL image representing Irit 4Hz Speech Segmentation - * grapher_irit_speech_4hz_segments_median : Builds a PIL image representing Irit 4Hz Speech Segmentation with median filter - * grapher_monopoly_segments : Builds a PIL image representing Irit Monopoly Segmentation - * grapher_limsi_sad_etape : Builds a PIL image representing LIMSI SAD with ETAPE model - * grapher_limsi_sad_maya : Builds a PIL image representing LIMSI SAD with Mayan model - * grapher_irit_startseg : Builds a PIL image representing IRIT Start Noise - * spectrogram_log : Builds a PIL image representing a spectrogram of the audio stream - * spectrogram_lin : Builds a PIL image representing a spectrogram of the audio stream (level vs. frequency vs. time). - * waveform_simple : Builds a PIL image representing a simple waveform of the audio stream. - * waveform_centroid : Builds a PIL image representing a waveform of the audio stream. - * waveform_contour_black : Builds a PIL image representing an amplitude coutour (envelop) of the audio stream. - * waveform_contour_white : Builds a PIL image representing an amplitude coutour (envelop) of the audio stream. - * waveform_transparent : Builds a PIL image representing a transparent waveform + * **grapher_aubio_pitch** : Builds a PIL image representing Aubio Pitch + * **grapher_onset_detection_function** : Builds a PIL image representing Onset detection function + * **grapher_waveform** : Builds a PIL image representing Waveform from Analyzer + * **grapher_irit_speech_4hz_segments** : Builds a PIL image representing Irit 4Hz Speech Segmentation + * **grapher_irit_speech_4hz_segments_median** : Builds a PIL image representing Irit 4Hz Speech Segmentation with median filter + * **grapher_monopoly_segments** : Builds a PIL image representing Irit Monopoly Segmentation + * **grapher_limsi_sad_etape** : Builds a PIL image representing LIMSI SAD with ETAPE model + * **grapher_limsi_sad_maya** : Builds a PIL image representing LIMSI SAD with Mayan model + * **grapher_irit_startseg** : Builds a PIL image representing IRIT Start Noise + * **spectrogram_log** : logarithmic scaled spectrogram (level vs. frequency vs. time). + * **spectrogram_lin** : Linear scaled spectrogram (level vs. frequency vs. time). + * **waveform_simple** : Simple monochrome waveform image. + * **waveform_centroid** : Waveform where peaks are colored relatively to the spectral centroids of each frame buffer. + * **waveform_contour_black** : Black amplitude contour waveform. + * **waveform_contour_white** : an white amplitude contour wavform. + * **waveform_transparent** : Transparent waveform. IAnalyzer --------- - * mean_dc_shift : Mean DC shift analyzer - * level : Audio level analyzer - * aubio_melenergy : Aubio Mel Energy analyzer - * aubio_mfcc : Aubio MFCC analyzer - * aubio_pitch : Aubio Pitch estimation analyzer - * aubio_specdesc : Aubio Spectral Descriptors collection analyzer - * aubio_temporal : Aubio Temporal analyzer - * yaafe : Yaafe feature extraction library interface analyzer - * irit_monopoly : Segmentor Monophony/Polyphony based on the analysis of yin confidence. - * irit_startseg : Segmentation of recording sessions into 'start' and 'session' segments - * irit_speech_4hz : Speech Segmentor based on the 4Hz energy modulation analysis. - * irit_speech_entropy : Speech Segmentor based on Entropy analysis. - * limsi_sad : Limsi Speech Activity Detection Systems - * spectrogram_analyzer : Spectrogram analyzer - * onset_detection_function : Onset Detection Function analyzer - * spectrogram_analyzer_2 : Spectrogram analyzer - * spectrogram_analyzer_3 : Spectrogram analyzer - * waveform_analyzer : Waveform analyzer + * **mean_dc_shift** : Mean DC shift analyzer + * **level** : Audio level analyzer + * **aubio_melenergy** : Aubio Mel Energy analyzer + * **aubio_mfcc** : Aubio MFCC analyzer + * **aubio_pitch** : Aubio Pitch estimation analyzer + * **aubio_specdesc** : Aubio Spectral Descriptors collection analyzer + * **aubio_temporal** : Aubio Temporal analyzer + * **yaafe** : Yaafe feature extraction library interface analyzer + * **irit_monopoly** : Segmentor Monophony/Polyphony based on the analysis of yin confidence. + * **irit_startseg** : Segmentation of recording sessions into 'start' and 'session' segments + * **irit_speech_4hz** : Speech Segmentor based on the 4Hz energy modulation analysis. + * **irit_speech_entropy** : Speech Segmentor based on Entropy analysis. + * **limsi_sad** : Limsi Speech Activity Detection Systems + * **spectrogram_analyzer** : Spectrogram analyzer + * **onset_detection_function** : Onset Detection Function analyzer + * **spectrogram_analyzer_2** : Spectrogram analyzer + * **spectrogram_analyzer_3** : Spectrogram analyzer + * **waveform_analyzer** : Waveform analyzer IEffect ------- - * fx_gain : Gain effect processor + * **fx_gain** : Gain effect processor diff --git a/timeside/core.py b/timeside/core.py index 2a4525e..30368d3 100644 --- a/timeside/core.py +++ b/timeside/core.py @@ -282,6 +282,22 @@ def get_processor(processor_id): def list_processors(interface=IProcessor, prefix=""): + print prefix + interface.__name__ + if len(prefix): + underline_char = '-' + else: + underline_char = '=' + print prefix + underline_char * len(interface.__name__) + subinterfaces = interface.__subclasses__() + for i in subinterfaces: + list_processors(interface=i, prefix=prefix + " ") + procs = processors(interface, False) + for p in procs: + print prefix + " * %s :" % p.id() + print prefix + " \t\t%s" % p.description() + + +def list_processors_rst(interface=IProcessor, prefix=""): print '\n' + prefix + interface.__name__ if len(prefix): underline_char = '-' @@ -290,10 +306,10 @@ def list_processors(interface=IProcessor, prefix=""): print prefix + underline_char * len(interface.__name__) + '\n' subinterfaces = interface.__subclasses__() for i in subinterfaces: - list_processors(interface=i, prefix=prefix + " ") + list_processors_rst(interface=i, prefix=prefix + " ") procs = processors(interface, False) for p in procs: - print prefix + " * %s : %s" % (p.id(), p.description()) + print prefix + " * **%s** : %s" % (p.id(), p.description()) class ProcessPipe(object): diff --git a/timeside/grapher/spectrogram_lin.py b/timeside/grapher/spectrogram_lin.py index 7e2e0ab..9b830d7 100644 --- a/timeside/grapher/spectrogram_lin.py +++ b/timeside/grapher/spectrogram_lin.py @@ -27,7 +27,8 @@ from timeside.grapher.spectrogram_log import SpectrogramLog class SpectrogramLinear(SpectrogramLog): - """ Builds a PIL image representing a spectrogram of the audio stream (level vs. frequency vs. time). + """Linear scaled spectrogram (level vs. frequency vs. time). + Adds pixels iteratively thanks to the adapter providing fixed size frame buffers.""" implements(IGrapher) diff --git a/timeside/grapher/spectrogram_log.py b/timeside/grapher/spectrogram_log.py index 21be1d2..2441781 100644 --- a/timeside/grapher/spectrogram_log.py +++ b/timeside/grapher/spectrogram_log.py @@ -29,8 +29,8 @@ import math class SpectrogramLog(Grapher): - """ Builds a PIL image representing a spectrogram of the audio stream - (level vs. frequency vs. time). + """logarithmic scaled spectrogram (level vs. frequency vs. time). + Adds pixels iteratively thanks to the adapter providing fixed size frame buffers.""" diff --git a/timeside/grapher/waveform_centroid.py b/timeside/grapher/waveform_centroid.py index d0ef61a..375ba1d 100644 --- a/timeside/grapher/waveform_centroid.py +++ b/timeside/grapher/waveform_centroid.py @@ -28,8 +28,8 @@ from timeside.grapher.color_schemes import default_color_schemes class WaveformCentroid(Waveform): - """ Builds a PIL image representing a waveform of the audio stream. - Peaks are colored relatively to the spectral centroids of each frame buffer. """ + """Waveform where peaks are colored relatively to the spectral centroids of each frame buffer. + """ implements(IGrapher) diff --git a/timeside/grapher/waveform_contour.py b/timeside/grapher/waveform_contour.py index 337c412..6d74eee 100644 --- a/timeside/grapher/waveform_contour.py +++ b/timeside/grapher/waveform_contour.py @@ -30,7 +30,7 @@ import numpy class WaveformContourBlack(Waveform): - """ Builds a PIL image representing an amplitude coutour (envelop) of the audio stream. + """Black amplitude contour waveform. """ implements(IGrapher) @@ -76,7 +76,7 @@ class WaveformContourBlack(Waveform): class WaveformContourWhite(WaveformContourBlack): - """ Builds a PIL image representing an amplitude coutour (envelop) of the audio stream. + """an white amplitude contour wavform. """ implements(IGrapher) diff --git a/timeside/grapher/waveform_simple.py b/timeside/grapher/waveform_simple.py index 43b9dda..8b2d43a 100644 --- a/timeside/grapher/waveform_simple.py +++ b/timeside/grapher/waveform_simple.py @@ -27,7 +27,7 @@ from . utils import peaks class Waveform(Grapher): - """ Builds a PIL image representing a simple waveform of the audio stream. + """Simple monochrome waveform image. """ implements(IGrapher) diff --git a/timeside/grapher/waveform_transparent.py b/timeside/grapher/waveform_transparent.py index 7dfd119..8f94419 100644 --- a/timeside/grapher/waveform_transparent.py +++ b/timeside/grapher/waveform_transparent.py @@ -28,8 +28,7 @@ from . utils import peaks class WaveformTransparent(Waveform): - """ Builds a PIL image representing a transparent waveform - of the audio stream. + """Transparent waveform. """ implements(IGrapher)