Metadata-Version: 2.4
Name: ovos-ocp-files-plugin
Version: 0.13.2a3
Summary: metadata extractor from audio files
Author-email: thebigmunch <mail@thebigmunch.me>
License: MIT
Project-URL: Homepage, https://github.com/OpenVoiceOS/ovos-ocp-files-plugin
Keywords: ovos,ocp,plugin
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: attrs>=18.2
Requires-Dist: bidict~=0.0
Requires-Dist: bitstruct<9.0,>=6.0
Requires-Dist: more-itertools<9.0,>=4.0
Requires-Dist: pprintpp~=0.0
Requires-Dist: wrapt
Requires-Dist: ovos-utils<1.0.0,>=0.1.0
Requires-Dist: ovos-plugin-manager<3.0.0,>=2.1.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-timeout; extra == "test"
Dynamic: license-file

# ovos-ocp-files-plugin

This plugin lets [OVOS Common Play (OCP)](https://github.com/OpenVoiceOS/ovos-plugin-manager) read local audio and video files. It reads file metadata, such as title, and reports the playback type so OCP can play the file.

It bundles a fork of [audio-metadata](https://github.com/thebigmunch/audio-metadata), adds MP4 support, and publishes it to PyPI as an updated dependency. There is no active development in this repository beyond packaging.

## Install

```bash
pip install ovos-ocp-files-plugin
```

## Usage

OCP loads this plugin through its extractor entry point. It handles a stream URI in the form `file//<path>` or a local file path, and returns metadata such as title and playback type:

```python
from ovos_ocp_files_plugin.plugin import OCPFilesMetadataExtractor

extractor = OCPFilesMetadataExtractor()
extractor.validate_uri("/home/user/music/song.mp3")  # True
meta = extractor.extract_metadata("/home/user/music/song.mp3")
```

## Related projects

- [OpenVoiceOS/ovos-plugin-manager](https://github.com/OpenVoiceOS/ovos-plugin-manager) defines the `OCPStreamExtractor` base class this plugin implements.
- [OpenVoiceOS/ovos-ocp-audio-plugin](https://github.com/OpenVoiceOS/ovos-ocp-audio-plugin) is a sibling OCP stream extractor.
- [thebigmunch/audio-metadata](https://github.com/thebigmunch/audio-metadata) is the upstream metadata library this plugin packages and extends.

## License

MIT
