用于控制 MOC(控制台上的音乐)音频播放器的 Python 库
项目描述
安装
安装实际的MOC 播放器/服务器
% sudo apt-get install -y moc or % brew install moc
然后用pip安装这个包
% pip3 install mocp
可选安装
redis-helper 和 yt-helper
如果安装了 redis-helper 和 yt-helper,每当调用moc.info_string()时,FILES 集合将更新为当前播放文件的基本名称
使用pip安装
% pip3 install "yt-helper[redis-helper]" or % pip3 install "mocp[extras]"
用法
In [1]: import moc
In [2]: moc.find_and_play('~/music-dir/blah*')
In [3]: moc.go('12:15') # jump to particular point in current track
In [4]: moc.go('1h23m12s') # jump to particular point in current track
In [5]: moc.go(500) # jump to particular point in current track
In [6]: moc.info_string()
Out[6]: '08:21 (501) of 95:35 into /home/user/music-dir/blah-thing/file.mp3'
获取 C 源代码
MOC 是用 C 编写的,并托管在 SVN 存储库(不是 Git)中。见man git-svn
$ git svn clone svn://svn.daper.net/moc/trunk moc