运行mpg123的与FIFO控制? [英] Running mpg123 with FIFO control?

查看:403
本文介绍了运行mpg123的与FIFO控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要用一个单独的文件运行mpg123的,这样它会自动启动和autoclose,喜欢它一般不会,但是,我需要能够覆盖与发送到FIFO文件中的命令此默认行为。

I need to run mpg123 with a single file, such that it will autostart and autoclose, like it normally does, however, I need to be able to override this default behavior with commands sent to a fifo file.

我已经从一个脚本运行 mpg123的FILENAME.MP3 ,并简单地等待它继续之前完成。不过,我想另外一个脚本能够尽早暂停播放,控制音量,或者杀的过程中,根据用户的输入。

I had been running mpg123 filename.mp3 from a script, and simply waiting for it to finish before moving on. However, I'd like another script to be able to pause playback, control volume, or kill the process early, depending on the user's input.

mpg123的-R --fifo / SRV / HTTP / newsctl FILENAME.MP3 似乎开始mpg123的,创造了管道,但不开始播放。

mpg123 -R --fifo /srv/http/newsctl filename.mp3 seems to start mpg123 and create the pipe, but does not start playback.

我如何使这项工作?

推荐答案

不幸的是mpg123的无法播放指定的文件时使用-R参数。
要开始播放你必须使用创建FIFO中加载文件。

Unfortunately mpg123 is unable to play a specified file when -R argument is used. To start the playback you have to load a file using created fifo.

FIFO_MPG='/srv/http/newsctl'
mpg123 -R --fifo "$FIFO_MPG"
echo 'load filename.mp3' >> "$FIFO_MPG"

另外,我建议你用沉默详细输出

Also I suggest you to silence verbose output by using

echo 'silence' >> "$FIFO_MPG"

我希望这不是为时已晚。祝你好运! ;)

I hope it is not too late. Good luck! ;)

这篇关于运行mpg123的与FIFO控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆