A contraption for async subprocess streaming
Project description
Async subprocess pipelines and stream transports:
"""An example of using ``reel`` to play music."""
import trio
from reel import Reel
from reel.cmd import ffmpeg, sox
async def main():
"""Play some audio files through the speakers."""
cornell77 = ''.join([
'http://archive.org/download/',
'gd1977-05-08.shure57.stevenson.29303',
'.flac16/gd1977-05-08d02t{}.flac'
])
tracks = [
'http://allotropic.com/static/out000.wav',
'http://allotropic.com/static/out001.wav',
'http://allotropic.com/static/out002.wav',
'http://allotropic.com/static/out003.wav',
'http://allotropic.com/static/out004.wav',
'http://allotropic.com/static/out005.wav',
cornell77.format('04'),
cornell77.format('05'),
'http://ice1.somafm.com/groovesalad-256-mp3',
]
playlist = Reel([ffmpeg.read(track) for track in tracks])
speakers = sox.speakers()
async with playlist | speakers as player:
await player.play()
if __name__ == '__main__':
trio.run(main)
Motivation
This project is a simplified version of Python subprocess control with pipes and asynchronous support. It is being developed to support tapedeck, a music streaming package which uses ffmpeg and other shell commands to get music from various sources to various destinations.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reel-0.0.8.tar.gz.
File metadata
- Download URL: reel-0.0.8.tar.gz
- Upload date:
- Size: 43.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0d659775ef0ec750ad1faaa8c58ab773a806dade28801014d458dc8fd78abe7
|
|
| MD5 |
8a7ea0d191b9aadb1d6317dc4e90d0a3
|
|
| BLAKE2b-256 |
aee4ecc7907c1be484d9a50f7f73520839eb5a5af8ba2f7cda4fed02cac7bea6
|
File details
Details for the file reel-0.0.8-py2.py3-none-any.whl.
File metadata
- Download URL: reel-0.0.8-py2.py3-none-any.whl
- Upload date:
- Size: 52.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb202abf379d8ef224bca4e1553478405b7a6255950abb27d558d7eb69b0d07e
|
|
| MD5 |
64d5261c613be199b61ba6efde56a644
|
|
| BLAKE2b-256 |
545abecda9a06edd872c356e84b685b5248497a1eff89345757b28329884a0c2
|