]> git.parisson.com Git - timeside.git/commitdiff
update doc, add new IRIT analyzers in news
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 18 Oct 2013 14:16:31 +0000 (16:16 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 18 Oct 2013 14:16:31 +0000 (16:16 +0200)
12 files changed:
doc/source/doc.rst
doc/source/examples/AnalyzerResult.rst [deleted file]
doc/source/examples/index.rst [deleted file]
doc/source/examples/tutorial.rst [deleted file]
doc/source/index.rst
doc/source/news.rst
doc/source/related.rst
doc/source/tutorial/AnalyzerResult.rst [new file with mode: 0644]
doc/source/tutorial/index.rst [new file with mode: 0644]
doc/source/tutorial/quick_start.rst [new file with mode: 0644]
doc/source/ui.rst
timeside/analyzer/core.py

index 994fea7ee7b8e65e5f325c8261fd562b53df3cce..57faed06e4fa33c04b8bf03632f58d0863263e42 100644 (file)
@@ -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/examples/AnalyzerResult.rst b/doc/source/examples/AnalyzerResult.rst
deleted file mode 100644 (file)
index c8a1527..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-.. This file is part of TimeSide
-   @author: Thomas Fillon
-
-=============================
- New analyzer Result example
-=============================
-
-Example of use of the new analyzerResult structure
-
-Usage : AnalyzerResult(data_mode=None, time_mode=None)
-
-See : :class:`timeside.analyzer.core.AnalyzerResult`
-
-Default
-=======
-
-Create a new analyzer result without arguments
-
-   >>> from timeside.analyzer.core import AnalyzerResult
-   >>> res = AnalyzerResult()
-
-This default result has all the metadata and dataObject attribute
-
-   >>> res.keys()
-   ['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'frame_metadata', 'label_metadata', 'parameters']
-
-   >>> for key,value in res.items():
-   ...     print '%s : %s' % (key, value)
-   ...
-   data_mode : None
-   time_mode : None
-   id_metadata : {'description': '', 'author': '', 'version': '', 'date': '', 'id': '', 'unit': '', 'name': ''}
-   dataObject : {'duration': array([], dtype=float64), 'time': array([], dtype=float64), 'value': None, 'label': array([], dtype=int64)}
-   audio_metadata : {'duration': None, 'start': 0, 'channelsManagement': '', 'uri': '', 'channels': None}
-   frame_metadata : {'blocksize': None, 'samplerate': None, 'stepsize': None}
-   label_metadata : {'label_type': 'mono', 'description': None, 'label': None}
-   parameters : {}
-
-
-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)
-
-
-Framewise
----------
-
->>> res = AnalyzerResult(time_mode='framewise')
->>> res.keys()
-['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'frame_metadata', 'label_metadata', 'parameters']
-
-Global
-------
-
-No frame metadata information is needed for these modes.
-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
-DataObject(value=None, label=array([], dtype=int64))
-
-Segment
--------
-
->>> res = AnalyzerResult(time_mode='segment')
->>> res.keys()
-['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'label_metadata', 'parameters']
->>> res.data
-DataObject(value=None, label=array([], dtype=int64), time=array([], dtype=float64), duration=array([], dtype=float64))
-
-Event
------
-
->>> res = AnalyzerResult(time_mode='event')
->>> res.keys()
-['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'label_metadata', 'parameters']
->>> res.data
-DataObject(value=None, label=array([], dtype=int64), time=array([], dtype=float64))
-
-Specification of data_mode
-=========================
-Two different data_mode can be specified :
-
-- 'value' : Data are returned as numpy Array of arbitrary type
-- 'label' : Data are returned as label indexes (specified by the label_metadata key)
-
-Value
------
-The label_metadata key is deleted.
-
->>> res = AnalyzerResult(data_mode='value')
->>> res.keys()
-['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'frame_metadata', 'parameters']
-
-In the dataObject key, the 'value' key is kept and the 'label' key is deleted.
-
->>> res.data
-DataObject(value=None, time=array([], dtype=float64), duration=array([], dtype=float64))
-
-Label
------
->>> res = AnalyzerResult(data_mode='label')
->>> res.keys()
-['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'frame_metadata', 'label_metadata', 'parameters']
-
-In the dataObject key, the 'label' key is kept and the 'value' key is deleted.
-
-
->>> res.data
-DataObject(label=array([], dtype=int64), time=array([], dtype=float64), duration=array([], dtype=float64))
diff --git a/doc/source/examples/index.rst b/doc/source/examples/index.rst
deleted file mode 100644 (file)
index c432506..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-.. TimeSide documentation master file, created by
-   sphinx-quickstart on Thu Aug 22 10:49:09 2013.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
-
-==============================================
-TimeSide : Examples
-==============================================
-Contents:
-
-.. toctree::
-   :maxdepth: 2
-
-      Tutorial <tutorial>
-      Usage of AnalyzerResult <AnalyzerResult>
-
-
diff --git a/doc/source/examples/tutorial.rst b/doc/source/examples/tutorial.rst
deleted file mode 100644 (file)
index 89ea664..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-==========
- Tutorial
-==========
-
-== 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")
- >>> pipe = decoder | encoder
- >>> pipe.run()
-
-As one can see in the above example, creating a processing pipe is performed with
-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]:
-
- >>> import timeside
- >>> decoder = timeside.decoder.FileDecoder('myfile.wav')
- >>> spectrogram = timeside.grapher.Spectrogram(width=400, height=150)
- >>> (decoder | spectrogram).run()
- >>> spectrogram.render().save('graph.png')
-
-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')
- >>> levels = timeside.analyzer.Level()
- >>> encoders = timeside.encoder.Mp3Encoder('myfile.mp3') | timeside.encoder.FlacEncoder('myfile.flac')
- >>> (decoder | levels | encoders).run()
- >>> print levels.results
index 8c1f37e9d47cfac1ba236ce9efcbc087839fe145..c750d968b27edbb1e2265d7214b2a1b96233c23c 100644 (file)
@@ -14,9 +14,9 @@ Contents:
    intro
    news
    Installation <install>
-   Examples <examples/index>
-   API <api/index>
+   Tutorial <examples/index>
    ui
+   API <api/index>
    Development <dev>
    related
    Copyright <copyright>
index db08ae1e38916f39bc662606fb401562fb5a2bcf..8eb224c552c3db1f1f945028a92728e992466b7b 100644 (file)
@@ -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
index c483f52f0d2f7177d30119f49b8abc7643743bca..aee539a645c264fa8b81876cee9e53c00875cdb5 100644 (file)
@@ -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 <http://telemeta.org>`_ 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 <http://telemeta.org>`_ : open source web audio CMS
+    * `Sound archives <http://archives.crem-cnrs.fr/>` 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/tutorial/AnalyzerResult.rst b/doc/source/tutorial/AnalyzerResult.rst
new file mode 100644 (file)
index 0000000..47c05d9
--- /dev/null
@@ -0,0 +1,116 @@
+.. This file is part of TimeSide
+   @author: Thomas Fillon
+
+Analyzer Result example
+=============================
+
+Example of use of the new analyzerResult structure
+
+Usage : AnalyzerResult(data_mode=None, time_mode=None)
+
+See : :class:`timeside.analyzer.core.AnalyzerResult`
+
+Default
+=======
+
+Create a new analyzer result without arguments
+
+   >>> from timeside.analyzer.core import AnalyzerResult
+   >>> res = AnalyzerResult()
+
+This default result has all the metadata and dataObject attribute
+
+   >>> res.keys()
+   ['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'frame_metadata', 'label_metadata', 'parameters']
+
+   >>> for key,value in res.items():
+   ...     print '%s : %s' % (key, value)
+   ...
+   data_mode : None
+   time_mode : None
+   id_metadata : {'description': '', 'author': '', 'version': '', 'date': '', 'id': '', 'unit': '', 'name': ''}
+   dataObject : {'duration': array([], dtype=float64), 'time': array([], dtype=float64), 'value': None, 'label': array([], dtype=int64)}
+   audio_metadata : {'duration': None, 'start': 0, 'channelsManagement': '', 'uri': '', 'channels': None}
+   frame_metadata : {'blocksize': None, 'samplerate': None, 'stepsize': None}
+   label_metadata : {'label_type': 'mono', 'description': None, 'label': None}
+   parameters : {}
+
+
+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)
+
+
+Framewise
+---------
+
+>>> res = AnalyzerResult(time_mode='framewise')
+>>> res.keys()
+['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'frame_metadata', 'label_metadata', 'parameters']
+
+Global
+------
+
+No frame metadata information is needed for these modes.
+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_object
+DataObject(value=None, label=array([], dtype=int64))
+
+Segment
+-------
+
+>>> res = AnalyzerResult(time_mode='segment')
+>>> res.keys()
+['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'label_metadata', 'parameters']
+>>> res.data
+DataObject(value=None, label=array([], dtype=int64), time=array([], dtype=float64), duration=array([], dtype=float64))
+
+Event
+-----
+
+>>> res = AnalyzerResult(time_mode='event')
+>>> res.keys()
+['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'label_metadata', 'parameters']
+>>> res.data
+DataObject(value=None, label=array([], dtype=int64), time=array([], dtype=float64))
+
+Specification of data_mode
+=========================
+Two different data_mode can be specified :
+
+- 'value' : Data are returned as numpy Array of arbitrary type
+- 'label' : Data are returned as label indexes (specified by the label_metadata key)
+
+Value
+-----
+The label_metadata key is deleted.
+
+>>> res = AnalyzerResult(data_mode='value')
+>>> res.keys()
+['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'frame_metadata', 'parameters']
+
+In the dataObject key, the 'value' key is kept and the 'label' key is deleted.
+
+>>> res.data
+DataObject(value=None, time=array([], dtype=float64), duration=array([], dtype=float64))
+
+Label
+-----
+>>> res = AnalyzerResult(data_mode='label')
+>>> res.keys()
+['data_mode', 'time_mode', 'id_metadata', 'data', 'audio_metadata', 'frame_metadata', 'label_metadata', 'parameters']
+
+In the dataObject key, the 'label' key is kept and the 'value' key is deleted.
+
+
+>>> res.data
+DataObject(label=array([], dtype=int64), time=array([], dtype=float64), duration=array([], dtype=float64))
diff --git a/doc/source/tutorial/index.rst b/doc/source/tutorial/index.rst
new file mode 100644 (file)
index 0000000..19142c4
--- /dev/null
@@ -0,0 +1,17 @@
+.. TimeSide documentation master file, created by
+   sphinx-quickstart on Thu Aug 22 10:49:09 2013.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+====================
+TimeSide : Tutorial
+====================
+Contents:
+
+.. toctree::
+   :maxdepth: 2
+
+      Quick start <quick_start>
+      Usage of AnalyzerResult <AnalyzerResult>
+
+
diff --git a/doc/source/tutorial/quick_start.rst b/doc/source/tutorial/quick_start.rst
new file mode 100644 (file)
index 0000000..def9c28
--- /dev/null
@@ -0,0 +1,33 @@
+ Quick start
+============
+
+A most basic operation, transcoding, is easily performed with two processors:
+
+ >>> import timeside
+ >>> decoder = timeside.decoder.FileDecoder('sweep.wav')
+ >>> encoder = timeside.encoder.VorbisEncoder("sweep.ogg")
+ >>> pipe = decoder | encoder
+ >>> pipe.run()
+
+As one can see in the above example, creating a processing pipe is performed with
+the binary OR operator.
+
+Audio data visualisation can be performed using graphers, such as Waveform and
+Spectrogram. All graphers return an image:
+
+ >>> import timeside
+ >>> decoder = timeside.decoder.FileDecoder('sweep.wav')
+ >>> spectrogram = timeside.grapher.Spectrogram(width=400, height=150)
+ >>> (decoder | spectrogram).run()
+ >>> spectrogram.render().save('graph.png')
+
+It is possible to create longer pipes, as well as subpipes, here for both
+analysis and encoding:
+
+ >>> import timeside
+ >>> decoder = timeside.decoder.FileDecoder('sweep.wav')
+ >>> levels = timeside.analyzer.Level()
+ >>> encoders = timeside.encoder.Mp3Encoder('sweep.mp3') | timeside.encoder.FlacEncoder('sweep.flac')
+ >>> (decoder | levels | encoders).run()
+ >>> print levels.results
+
index 759799eac128a0a86fdfd12fe3db477d066b7012..78b40fa7e0f11fb60cba8c6fc846018cb1bd7a0d 100644 (file)
@@ -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
index e2d8ec1e1cc7e877ec1c10d9a49a9004c1dc1643..4c7ccc363af9bf0077dadd94de9f4ed6f47ef956 100644 (file)
@@ -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
     <timeside.core.ProcessPipe object at 0x...>
     >>> 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