异步子进程管道和流传输

reel的Python项目详细描述


异步子流程管道和流传输:

"""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)

动机

此项目是python子进程控件的简化版本 管道和异步支撑。正在开发它来支持 tapedeck, 使用ffmpeg和其他shell命令的音乐流包 从不同的音乐来源到不同的目的地。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java检查服务器端广告查看(php)   Java将注释的使用限制在某些类型的方法上?   java使用gson重用顶级模型   当Java Spring作为Docker容器运行时,它不会与Concur对话   通过Java在不使用新URL()的情况下加载文件   Dicom4che调用的java结果不显示umlaut字符   java Updatea使用php/codeigniter使用ajax/javascript映射标记   Java8中的javaspringboot@ExceptionHandler未被访问   java如何读取长度未知的用户输入?   EclipseJava在MacBook和OSX上的性能非常差,而在Windows下在同一个单元上的性能就不那么差了,为什么?   java在Lucene查询语法中与+有什么区别   使用Spark和Cassandra Java驱动程序时检测到番石榴问题#1635   java工具栏标题未显示在选项卡式活动中