.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_examples/ex1_discovery.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr__examples_ex1_discovery.py: Plugin discovery and browsing ============================= .. GENERATED FROM PYTHON SOURCE LINES 5-15 .. code-block:: Python import os from pathlib import Path from pprint import pprint import rtvamp # set VAMP_PATH to rtvamp package dir to find example plugins os.environ["VAMP_PATH"] = os.path.dirname(rtvamp.__file__) .. GENERATED FROM PYTHON SOURCE LINES 16-19 Browse available libraries and plugins -------------------------------------- List libraries: .. GENERATED FROM PYTHON SOURCE LINES 19-21 .. code-block:: Python rtvamp.list_libraries() .. rst-class:: sphx-glr-script-out .. code-block:: none [PosixPath('/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/rtvamp/plugins/example-plugin.so')] .. GENERATED FROM PYTHON SOURCE LINES 22-23 List plugins: .. GENERATED FROM PYTHON SOURCE LINES 23-25 .. code-block:: Python rtvamp.list_plugins() .. rst-class:: sphx-glr-script-out .. code-block:: none ['example-plugin:rms', 'example-plugin:spectralrolloff'] .. GENERATED FROM PYTHON SOURCE LINES 26-27 List plugins in current working directory: .. GENERATED FROM PYTHON SOURCE LINES 27-29 .. code-block:: Python rtvamp.list_plugins(paths=[Path.cwd()]) .. rst-class:: sphx-glr-script-out .. code-block:: none [] .. GENERATED FROM PYTHON SOURCE LINES 30-31 Get metadata and descriptors from plugin .. GENERATED FROM PYTHON SOURCE LINES 31-37 .. code-block:: Python for plugin in rtvamp.list_plugins(): try: metadata = rtvamp.get_plugin_metadata(plugin) pprint(metadata) except: print(f"Could not get metadata from plugin {plugin}") .. rst-class:: sphx-glr-script-out .. code-block:: none PluginMetadata(identifier='rms', name='RMS', description='Root mean square', maker='LB', copyright='MIT', plugin_version=1, input_domain='time', parameter_descriptors=[], output_descriptors=[{'bin_count': 1, 'bin_names': [], 'description': 'Root mean square of signal', 'has_known_extents': False, 'identifier': 'rms', 'max_value': 0.0, 'min_value': 0.0, 'name': 'RMS', 'quantize_step': None, 'unit': 'V'}]) PluginMetadata(identifier='spectralrolloff', name='Spectral roll-off', description='', maker='LB', copyright='MIT', plugin_version=1, input_domain='frequency', parameter_descriptors=[{'default_value': 0.8999999761581421, 'description': 'Some random parameter', 'identifier': 'rolloff', 'max_value': 1.0, 'min_value': 0.0, 'name': 'Roll-off factor', 'quantize_step': None, 'unit': '', 'value_names': []}], output_descriptors=[{'bin_count': 1, 'bin_names': [], 'description': 'Frequency below which n% ' 'of the total energy is ' 'concentrated', 'has_known_extents': False, 'identifier': 'frequency', 'max_value': 0.0, 'min_value': 0.0, 'name': 'Roll-off frequency', 'quantize_step': None, 'unit': 'Hz'}]) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.010 seconds) .. _sphx_glr_download__examples_ex1_discovery.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: ex1_discovery.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: ex1_discovery.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: ex1_discovery.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_