From 54ec3b9a8f2c599283ee67e75f6a1f91dfcfc5b7 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Fri, 18 Oct 2013 16:16:31 +0200 Subject: [PATCH] update doc, add new IRIT analyzers in news --- doc/source/doc.rst | 4 +++- doc/source/index.rst | 4 ++-- doc/source/news.rst | 7 ++++--- doc/source/related.rst | 20 +++++++++++++------ .../{examples => tutorial}/AnalyzerResult.rst | 11 +++++----- doc/source/{examples => tutorial}/index.rst | 8 ++++---- .../tutorial.rst => tutorial/quick_start.rst} | 20 +++++++++---------- doc/source/ui.rst | 6 +++--- timeside/analyzer/core.py | 17 ++++++++-------- 9 files changed, 53 insertions(+), 44 deletions(-) rename doc/source/{examples => tutorial}/AnalyzerResult.rst (91%) rename doc/source/{examples => tutorial}/index.rst (68%) rename doc/source/{examples/tutorial.rst => tutorial/quick_start.rst} (59%) diff --git a/doc/source/doc.rst b/doc/source/doc.rst index 994fea7..57faed0 100644 --- a/doc/source/doc.rst +++ b/doc/source/doc.rst @@ -1,5 +1,7 @@ API / Documentation ==================== -http://files.parisson.com/timeside/doc/ +* General : http://files.parisson.com/timeside/doc/ +* Tutorial : http://files.parisson.com/timeside/doc/examples/index.html +* API : http://files.parisson.com/timeside/doc/api/index.html diff --git a/doc/source/index.rst b/doc/source/index.rst index 8c1f37e..c750d96 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -14,9 +14,9 @@ Contents: intro news Installation - Examples - API + Tutorial ui + API Development related Copyright diff --git a/doc/source/news.rst b/doc/source/news.rst index db08ae1..8eb224c 100644 --- a/doc/source/news.rst +++ b/doc/source/news.rst @@ -5,9 +5,10 @@ News * Deep refactoring of the analyzer API to handle various new usecases, specifically audio feature extraction * Add serializable global result container (NEW dependency to h5py, json, yaml) - * Add new audio feature extraction analyzers thanks to the Aubio library providing beat & BPM detection, pitch dectection and other cool stuff (NEW dependency) - * Add new audio feature extraction analyzers thanks to the Yaafe library (NEW dependency) - * EXPERIMENTAL : add new audio feature extraction thanks to the VAMP plugin library (NEW dependency) + * Add new audio feature extraction analyzers thanks to the Aubio library providing beat & BPM detection, pitch dectection and other cool stuff (NEW dependency on aubio) + * Add new audio feature extraction analyzers thanks to the Yaafe library (NEW dependency on yaafe) + * Add new IRIT speech detection analyzers (NEW dependency on scipy) + * EXPERIMENTAL : add new audio feature extraction thanks to the VAMP plugin library (NEW dependency on some vamp toold) * Add new documentation : http://files.parisson.com/timeside/doc/ * New Debian repository for instant install * Various bugfixes diff --git a/doc/source/related.rst b/doc/source/related.rst index c483f52..aee539a 100644 --- a/doc/source/related.rst +++ b/doc/source/related.rst @@ -1,12 +1,20 @@ +Sponsors and Patners +==================== + + * CNRS (National Center of Science Research, France) + * TGE Adonis (big data equipment for human sciences) + * CREM (french National Center of Ethomusicology Research, France) + * Université Pierre et Marie Curie (UPMC Paris, France) + * ANR (CONTINT 2012 project : DIADEMS) + * MNHN : + + Related projects ================= -TimeSide has emerged in 2010 from the `Telemeta project `_ which develops a free and open source web audio CMS. Find a direct example of application here : http://archives.crem-cnrs.fr/ - -This project has been sponsored by: + * `Telemeta `_ : open source web audio CMS + * `Sound archives ` of the CNRS, CREM and the "Musée de l'Homme" in Paris. + * DIADEMS : - * CNRS (french center of national research) - * TGE Adonis - * CREM (Nanterre, UPMC (Paris), diff --git a/doc/source/examples/AnalyzerResult.rst b/doc/source/tutorial/AnalyzerResult.rst similarity index 91% rename from doc/source/examples/AnalyzerResult.rst rename to doc/source/tutorial/AnalyzerResult.rst index c8a1527..47c05d9 100644 --- a/doc/source/examples/AnalyzerResult.rst +++ b/doc/source/tutorial/AnalyzerResult.rst @@ -1,8 +1,7 @@ .. This file is part of TimeSide @author: Thomas Fillon -============================= - New analyzer Result example +Analyzer Result example ============================= Example of use of the new analyzerResult structure @@ -42,9 +41,9 @@ Specification of time_mode Four different time_mode can be specified : - 'framewise' : Data are returned on a frame basis (i.e. with specified blocksize, stepsize and framerate) -- 'global' : A global data value is return for the entire audio item -- 'segment' : Data are returned on a segmnet basis (i.e. with specified start time and duration) -- 'event' : Data are returned on a segment basis (i.e. with specified start time) +- 'global' : A global data value is return for the entire audio item +- 'segment' : Data are returned on a segmnet basis (i.e. with specified start time and duration) +- 'event' : Data are returned on a segment basis (i.e. with specified start time) Framewise @@ -63,7 +62,7 @@ The 'frame_metadata' key/attribute is deleted. >>> res = AnalyzerResult(time_mode='global') >>> res.keys() ['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'label_metadata', 'parameters'] ->>> res.data +>>> res.data_object DataObject(value=None, label=array([], dtype=int64)) Segment diff --git a/doc/source/examples/index.rst b/doc/source/tutorial/index.rst similarity index 68% rename from doc/source/examples/index.rst rename to doc/source/tutorial/index.rst index c432506..19142c4 100644 --- a/doc/source/examples/index.rst +++ b/doc/source/tutorial/index.rst @@ -3,15 +3,15 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -============================================== -TimeSide : Examples -============================================== +==================== +TimeSide : Tutorial +==================== Contents: .. toctree:: :maxdepth: 2 - Tutorial + Quick start Usage of AnalyzerResult diff --git a/doc/source/examples/tutorial.rst b/doc/source/tutorial/quick_start.rst similarity index 59% rename from doc/source/examples/tutorial.rst rename to doc/source/tutorial/quick_start.rst index 89ea664..def9c28 100644 --- a/doc/source/examples/tutorial.rst +++ b/doc/source/tutorial/quick_start.rst @@ -1,14 +1,11 @@ -========== - Tutorial -========== - -== Quick Start == + Quick start +============ A most basic operation, transcoding, is easily performed with two processors: >>> import timeside - >>> decoder = timeside.decoder.FileDecoder('myfile.wav') - >>> encoder = timeside.encoder.VorbisEncoder("myfile.ogg") + >>> decoder = timeside.decoder.FileDecoder('sweep.wav') + >>> encoder = timeside.encoder.VorbisEncoder("sweep.ogg") >>> pipe = decoder | encoder >>> pipe.run() @@ -16,10 +13,10 @@ As one can see in the above example, creating a processing pipe is performed wit the binary OR operator. Audio data visualisation can be performed using graphers, such as Waveform and -Spectrogram. All graphers return a [http://www.pythonware.com/library/pil/handbook/image.htm PIL image]: +Spectrogram. All graphers return an image: >>> import timeside - >>> decoder = timeside.decoder.FileDecoder('myfile.wav') + >>> decoder = timeside.decoder.FileDecoder('sweep.wav') >>> spectrogram = timeside.grapher.Spectrogram(width=400, height=150) >>> (decoder | spectrogram).run() >>> spectrogram.render().save('graph.png') @@ -28,8 +25,9 @@ It is possible to create longer pipes, as well as subpipes, here for both analysis and encoding: >>> import timeside - >>> decoder = timeside.decoder.FileDecoder('myfile.wav') + >>> decoder = timeside.decoder.FileDecoder('sweep.wav') >>> levels = timeside.analyzer.Level() - >>> encoders = timeside.encoder.Mp3Encoder('myfile.mp3') | timeside.encoder.FlacEncoder('myfile.flac') + >>> encoders = timeside.encoder.Mp3Encoder('sweep.mp3') | timeside.encoder.FlacEncoder('sweep.flac') >>> (decoder | levels | encoders).run() >>> print levels.results + diff --git a/doc/source/ui.rst b/doc/source/ui.rst index 759799e..78b40fa 100644 --- a/doc/source/ui.rst +++ b/doc/source/ui.rst @@ -1,7 +1,7 @@ -HTML5 User Interface -==================== +User Interface +=============== -TimeSide comes with a smart and pure HTML5 audio player. +TimeSide comes with a smart and pure **HTML5** audio player. Features: * embed it in any audio web application diff --git a/timeside/analyzer/core.py b/timeside/analyzer/core.py index e2d8ec1..4c7ccc3 100644 --- a/timeside/analyzer/core.py +++ b/timeside/analyzer/core.py @@ -573,8 +573,10 @@ class AnalyzerResult(MetadataObject): @property def data(self): if self.data_mode is None: - return {key: self.data_object[key] for key in ['value', 'label'] if key in self.data_object.keys()} - + return ( + {key: self.data_object[key] + for key in ['value', 'label'] if key in self.data_object.keys()} + ) elif self.data_mode is 'value': return self.data_object.value elif self.data_mode is 'label': @@ -635,19 +637,18 @@ class AnalyzerResult(MetadataObject): class AnalyzerResultContainer(dict): ''' - >>> from timeside.decoder import FileDecoder - >>> import timeside.analyzer.core as coreA + >>> import timeside >>> import os >>> ModulePath = os.path.dirname(os.path.realpath(coreA.__file__)) >>> wavFile = os.path.join(ModulePath , '../../tests/samples/sweep.wav') - >>> d = FileDecoder(wavFile, start=1) + >>> d = timeside.decoder.FileDecoder(wavFile, start=1) - >>> a = coreA.Analyzer() + >>> a = timeside.analyzer.Analyzer() >>> (d|a).run() #doctest: +ELLIPSIS >>> a.new_result() #doctest: +ELLIPSIS AnalyzerResult(data_mode=None, time_mode=None, id_metadata=id_metadata(id='', name='', unit='', description='', date='...', version='...', author='TimeSide'), data=DataObject(value=None, label=array([], dtype=int64), time=array([], dtype=float64), duration=array([], dtype=float64)), audio_metadata=audio_metadata(uri='file:///.../tests/samples/sweep.wav', start=1.0, duration=7.0, channels=None, channelsManagement=''), frame_metadata=FrameMetadata(samplerate=None, blocksize=None, stepsize=None), label_metadata=LabelMetadata(label=None, description=None, label_type='mono'), parameters={}) - >>> resContainer = coreA.AnalyzerResultContainer() + >>> resContainer = timeside.analyzer.AnalyzerResultContainer() ''' @@ -916,7 +917,7 @@ class Analyzer(Processor): Attributes ---------- - data : MetadataObject + data_object : MetadataObject id_metadata : MetadataObject audio_metadata : MetadataObject frame_metadata : MetadataObject -- 2.39.5