Skip to main content

ffplay plugin for ovos

Project description

ovos-media-plugin-ffplay

ffplay plugin for ovos-audio and ovos-media

Install

pip install ovos-media-plugin-ffplay

Configuration

edit your mycroft.conf with any ffplay players you want to expose

{
  "Audio": {
    "backends": {
      "ffplay": {
        "type": "ovos_ffplay",
        "active": true
      }
    }
  }
}

Python usage

direct access to ffplay is provided via FFPlayAudioPlayer

import time
from ovos_media_plugin_ffplay.ffplay import FFPlayAudioPlayer

# Example usage: playing an MP3 file from a URL
url = "https://github.com/OpenVoiceOS/ovos-skill-easter-eggs/raw/refs/heads/dev/sounds/sing/drnimpo-robots.mp3"

# Create player instance
player = FFPlayAudioPlayer()

# Play media
player.play(url, volume=100)
print(f"Playback time: {player.playback_time} ms")
time.sleep(5)
print(f"Playback time: {player.playback_time} ms")

# Pause media
player.pause()
time.sleep(2)
print(f"Playback time: {player.playback_time} ms")

# Resume media
player.resume()
time.sleep(1)
player.set_track_position(65)
print(f"Playback time: {player.playback_time} ms")
print(f"Volume: {player.volume}")
time.sleep(3)
player.set_volume(30)
print(f"Volume: {player.volume}")
time.sleep(6)
player.set_volume(70)
print(f"Volume: {player.volume}")
player.wait_for_end_of_playback()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovos_media_plugin_ffplay-0.0.3a3.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ovos_media_plugin_ffplay-0.0.3a3-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file ovos_media_plugin_ffplay-0.0.3a3.tar.gz.

File metadata

File hashes

Hashes for ovos_media_plugin_ffplay-0.0.3a3.tar.gz
Algorithm Hash digest
SHA256 e12a1f375b961461383af6048b37ec015eb929441b12cce331f71c467d5eb3a4
MD5 c33b066f473cb3c1506251f9bb5a1a13
BLAKE2b-256 593e84bc70ed83ca9793027ac9f1252ad8d1549aff4dde075ff5fab60b9e3cb3

See more details on using hashes here.

File details

Details for the file ovos_media_plugin_ffplay-0.0.3a3-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_media_plugin_ffplay-0.0.3a3-py3-none-any.whl
Algorithm Hash digest
SHA256 f7d4e1c4120750edbd086330f1be7656ea13040628613a66c3d60f6ba53ad4f4
MD5 76ee4e6c14f1ce16f066cc881e50a0c7
BLAKE2b-256 efc10709d3704c1299bdae3757e81eb8461076b042401bef9f2b66a478bb6a28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page