LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Background Mplayer from Console (http://www.linuxquestions.org/questions/linux-general-1/background-mplayer-from-console-207710/)

paco36 07-21-2004 12:12 AM

Background Mplayer from Console
 
I was wondering if there was any way to do this. I want to run mplayer from the console to play audio. When I issue the command mplayer MySong.mp3 or whatever it plays the song. However I want it to run in the background so that I can have mplayer running while I am in console WITHOUT starting X. Basicaly I want to listen to music while I do other stuff in console. Is this at all possible?

Thanks,
paco

newinlinux 07-21-2004 12:25 AM

u can use one console for one proggy. BTW, i use madplay for my mp3.

oot 07-21-2004 10:18 AM

Three command-line programs you might already have are mpg123, mpg321, and play. Any of these (if you have them) should be able to play your mp3 files.

If you want one of these to run in the background instead of hogging the console, put "&" at the end.

paco36 07-21-2004 12:28 PM

Thanks, I've gotten mpg123 to correctly play mp3's in the background using mpg123 *.mp3 &. However I do have many wma's. That's why I am trying to get mplayer to work. But when I use mplayer *.wma & it brings up a whole bunch of messages and hangs with no sound output. Any Ideas?

Thanks again,
paco

oot 07-21-2004 01:02 PM

You probably can't do that, because mplayer will want to open a window even if it's running in the background. "play" may or may not handle wmas (it handles a lot of formats). Other than that, I don't really know what to suggest.

BinaryLinux 07-21-2004 07:46 PM

Re: Background Mplayer from Console
 
Quote:

Originally posted by paco36
I was wondering if there was any way to do this. I want to run mplayer from the console to play audio. When I issue the command mplayer MySong.mp3 or whatever it plays the song. However I want it to run in the background so that I can have mplayer running while I am in console WITHOUT starting X. Basicaly I want to listen to music while I do other stuff in console. Is this at all possible?

Thanks,
paco

I've had the same problem and I got round this by logging into two consoles as the same user, you have up to six consoles to use and you can access the different ones by pressing ALT+F1 to ALT+F6 depending on which one you want to use.

I personally use console 1 to do work or whatever else I want to do and use console 2 for playing my mp3s. Hope this helps. :)

vinay_s_s 07-21-2004 07:56 PM

u can try nohup

for more info, see
man nohup

paco36 07-22-2004 11:09 AM

Thanks for the help! Logging into two consoles works great.

Thanks again,
-paco

flake 02-07-2013 04:12 PM

You should try with -noconsolecontrols and -quiet ,
and & at the end

sycamorex 02-07-2013 04:22 PM

I know you have asked specifically about mplayer but IMHO mpd/ncmpcpp is ideal for something like that. Although the server/client model might sound complicated, it's not. After the initial configuration, you just start mpd and one of its clients - ncmpcpp is imho the best mpd's cli client. You select your music/playlist/tracks and play them. You can exit ncmpcpp, do some things on the terminal and the music will be played in the background. Furthermore, you can change your desktop environment/window manager and the music will constantly be playing. You can even log out (kill X and completely logout in runlevel 3 and the music will not be interrupted. To be precise, when I go to bed and shutdown -h now my system, the music stops somewhere halfway through the system shutdown process.

mpd/ncmpcpp are full of features including editing tags, fetching lyrics, cli audio visualisation, to name a few.

273 02-07-2013 04:59 PM

I echo the mpd/ncmpcpp recommendation. It is a little tricky yo set up if you're new to it but since discovering it I've not used anything else.
Oh, and another solution to your problem, and others, could be to use screen allowing for console switching and even split-screen with two or more consoles.

Loomx 02-08-2013 03:09 AM

You can't beat mplayer on the console, I reckon.
It does the business now, and it did in 2004, which incidentally is when this thread was started :)

sycamorex 02-08-2013 03:38 AM

LoL. Did not notice how old it is.

273 02-08-2013 04:48 AM

Me neither, oh well.


All times are GMT -5. The time now is 09:10 PM.