I have installed play
:
sudo apt-get install sox libsox-fmt-mp3
I can now play my audio files like this :
play Desktop/SONGS/01\ -\ Oh\ Baby\ Girl.mp3
Since I'm learning shell, I wish I could do something like this :
(sleep 10 ; play Desktop/SONGS/01\ -\ Oh\ Baby\ Girl.mp3 ) &
After 10
sec's, I can see the screen as :
File Size: 7.38M Bit Rate: 260k
Encoding: MPEG audio Info: 2012
Channels: 2 @ 16-bit Track: 01/09
Samplerate: 44100Hz Album: Maalai Pozhudhin Mayakathilaey :::tunesinn.blogspot.com:::
Replaygain: off Artist: Hemachandra, Achu
Duration: 00:03:46.98 Title: Oh Baby Girl
But the song is not playing. But if I do this (without &
) :
(sleep 10 ; play Desktop/SONGS/01\ -\ Oh\ Baby\ Girl.mp3 )
Is working as expected. But I couldn't able to use my terminal in meanwhile.
How could I resolve my problem, with using &
?
Backgrounding
play
with&
fails becauseplay
wants to output its status, e.g.but cannot if backgrounded. So it keeps waiting until aborted.
To solve this, simply run
play
with the-q
(quiet) switch. This will successfully background it andplay
will terminate when the song ends.there is a better way of running things in the "background" from the command line.
sudo apt-get install tmux
Its one of the most nifty command line programs for Linux. it allows you to have something similar to "tabs in a browser" and switching seamlessly between them without any interruption of running programs. It's not tabs in the terminal program itself though. But within that specific shell you have started.
once install start it by typing
in a terminal.
you create new "tabs" with ctrl-A c you switch to next tab with ctrl-A n
here is a more thorough tutorial if you find the man pages hard to understand
This worked for me with mplayer
My Nautilus-Actions to add "Play" and "Stop" to the context menu for audio files
To Add Play...
Define a new action as follows
Or add more if needed or leave it alone to show up everywhere.
To Add Stop...
Define a new action as follows
Or add more if needed or leave it alone to show up everywhere.
I use
vlc is pretty ubiquitous.
There are many players in the market. You can try open source which is opensource and cross platform. It is mplayer. Try this command to check it is either there or not.
You will see the manual or documentation of this command. You can play you the audio file. Check your drivers. You should have drivers before use it. If you don't this player install it with apt command in Ubuntu 16.04 LTS or apt-get command.
or
use it simply by typing mplayer and file name after that.