Saturday, February 24, 2024
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 4268  / 3 Years ago, wed, july 14, 2021, 1:51:20

I'm looking for a replacement for mplayer. mplayer is a audio player for the console. It works just fine when I use it like so:



 mplayer /path/to/audio.mp3


But when I start it in the background I get this error message:



 :~$ mplayer /home/.alarm-sounds/alien1.wav &
[3] 15451
:~$ MPlayer svn r34540 (Ubuntu), built with gcc-4.7 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.


I'm trying to write a little alarm script because I want to practice some modified version of pomodoro.


More From » command-line

 Answers
5

From the manual:




Q: How can I run MPlayer in the background?

A: Use: mplayer options filename < /dev/null &




The redirect (note it's an input from /dev/null) is critical. mplayer is expecting input.



So in my case, the following works:



mplayer -nolirc ~/Music/Aqua/Aquarium/Aqua - 03 - Barbie Girl.mp3 < /dev/null &


This is a shorter variation:



cat 0 | mplayer ~/Music/Aqua/Aquarium/Aqua - 03 - Barbie Girl.mp3 &

[#29613] Wednesday, July 14, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lowstonnequ

Total Points: 279
Total Questions: 125
Total Answers: 123

Location: Finland
Member since Sun, Dec 5, 2021
2 Years ago
;