Simple audio player needed

Audio editors, music players, video players, burning software, etc.
Message
Author
mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

PeasyMP3 pause control, retrovol, and ogg capability beta

#21 Post by mcewanw »

rcrsn51, in case you want to use these additions I've made to your program PeasyMP3 for my own current use, please find attached a dotpet of the altered version. This includes the above retrovol code changes, ffmpeg for ogg capability, and a larger change being the addition of a pause control. The pause control code (in fact all of these additions) is borrowed from precord/pavrecord. I've marked most of the lines I've added or modified in your original with # mcewanw.

Useful controls for mplayer (keyboard shortcuts etc) can be found at these links:

http://www.mplayerhq.hu/DOCS/HTML/en/control.html

http://www.mplayerhq.hu/DOCS/man/en/mpl ... %20CONTROL

NOTE WELL: I've named this dotpet as a beta; I really haven't had time to give it much of a test (my one year old baby was pulling at my arm as I coded...)! Also, I didn't want to alter your own code too much, so I just placed most of the new code in functions of its own and a few clean up lines just at the end of the program, so that could probably be tidied up at least. Also, I just stuck a simple pause button on the GUI. Pressing Resume (or most any other button) unpauses; a side effect is that on unpausing you would need to press the Resume button twice if you really also want to Resume. You'll understand what I mean if you test it. With slight alterateion to the code could make pause control a toggle action if you like - I think I prefer it as provided here instead (tho could have both).

EDIT: The change needed would be this function:

Code: Select all

PAUSEPLAY (){ # mcewanw
 # putting following if...elif statement in would give pause control a toggle action. Similar line could then be removed from CONTROL function, or have both
  if [ -e ${TMPFOLDER}/pauseplay ];then
    UNPAUSEPLAY # mcewanw
  elif [ -e ${TMPFOLDER}/play.pid ];then
    PEASYPIDPLAY=$(cat ${TMPFOLDER}/play.pid 2>/dev/null)
    kill -STOP $PEASYPIDPLAY 2>/dev/null
    touch ${TMPFOLDER}/pauseplay
  fi
}
Hope some of this is useful or helpful, mcewanw

NOTE: I notice that some programs, for example ffconvert, allows files to be send directly to them via right click (not just Open With). Seems to just be a matter of having the symlink to the program in all the hidden subfolders of OpenWith, such as .video_mp4, of /root/.config/rox.sourceforge.net/OpenWith but I'm not sure of that or how it is best set up.
Attachments
peasymp3-2.7withpause.pet
with added pause button, retrovol mixer, and ogg capability.
(3.08 KiB) Downloaded 276 times
Last edited by mcewanw on Fri 14 Jun 2013, 23:42, edited 2 times in total.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

PeasyMP3 with added pause button, using retrovol, ogg etc

#22 Post by mcewanw »

Next most useful thing, I feel, that would be good to add would be the ability for the program to work through a hierarchy of directories like the feature disciple talked about in 1by1 program. Even as PeasyMP3 stands, however, it is definitely my favourite current music/media player on Puppy - no complicated frill, low-resource usage, and simple to use...

I'm particularly glad you wrote your code all in one script, which made it much easier for me to quickly incorporate the code extract additions from Precord - I find it a nightmare working with code whose functions are stored in a whole heap of different scripts. Just my preference to keep most everything together I suppose. Too much modularisation and I get lost! I realise that many likely have an opposite view on this matter.
github mcewanw

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#23 Post by tempestuous »

Yes, PeasyMP3 looks OK, but it's not quite as elegant as xhippo, which has been used with Puppy Linux and various low-powered computers since 2006.
Screenshot attached.
PaulR wrote:I don't want to install anthing >10Mb !
How does 23kb sound ?!!!
Install just the xhippo gui - xhippo-3.5-gtk2.pet
http://www.murga-linux.com/puppy/viewto ... 017#306017
By default, this dotpet package is configured to use Puppy's madplay executable for MP3 playback.

If you need AAC, WMA, or FLAC support, install the full xhippo+LAMIP dotpet -
http://www.murga-linux.com/puppy/viewto ... 6787#66787
which is still just a modest 650kb.
Attachments
xhippo.jpg
(42.95 KiB) Downloaded 329 times

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#24 Post by tempestuous »

And if you're interested in a rundown of Linux audio player applications, from simple to full-featured, please see "Audio player applications - THE LIST"
http://www.murga-linux.com/puppy/viewtopic.php?t=79110

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#25 Post by mcewanw »

tempestuous wrote:Yes, PeasyMP3 looks OK, but it's not quite as elegant as xhippo, which has been used with Puppy Linux and various low-powered computers since 2006.
Yes, I've also tried xhippo some years ago, and goingnuts, I think it was, also made a nicer looking gtk1 version a while back. Lamip adds quite a bit extra size though, and I don't think madplay is in Puppies by default anymore.

xhippo was certainly the nearest to what I myself was looking for as a low-resource replacement for my needs to what Puppy generally provides, but it seemed to fall slightly short of what I was looking for. That's why I find PeasyMP3 interesting, because it should be easy to modify it should extra functionality be required. Hopefully not too many additions though since simplicity is one of its attractions I feel.

If the simple xhippo frontend can be configured to work with ffmpeg, lame, aplay, and mplayer for video files, that would be a good alternative to PeasyMP3. Having said that, PeasyMP3 hasn't been around long and being a simple shell script I'm sure it shouldn't be too hard to improve its elegance!
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

xhippo as general process group frontend

#26 Post by mcewanw »

mcewanw wrote: If the simple xhippo frontend can be configured to work with ffmpeg, lame, aplay, and mplayer for video files, that would be a good alternative to PeasyMP3.
I'll answer my own question. Yes, xhippo can be configured to work with lame, aplay and so on: I just did so. You need to use the g flag in the config script to run the commands as a process group. Very interesting. You can use xhippo as a general process group frontend, not just for music files. Pity BarryK didn't include xhippo in Puppy by default.

Summary: with xhippo you don't need lamip; can just use it with ffmpeg, lame, aplay and so on (in a pipe) if you don't have madplay or mpg123.

My only gripe that remains with xhippo is that I haven't managed to change the buttons in xhippo to gtk stock items for play stop pause etc. goingnuts managed that with his gtk1 version, and posted that to me long time back, but not gtk2. Hence another of my reasons for liking PeasyMP3 - all these things and more could Peasily be added to it (sorry), including different looks and feel, without bloating the code too much (Peasy is only a couple of kB download as it stands). It would probably not be too difficult to program it to have identical or better look and feel to xhippo.
Last edited by mcewanw on Fri 14 Jun 2013, 19:55, edited 5 times in total.
github mcewanw

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#27 Post by greengeek »

Any way of getting xhippo to remember the last directory that I picked an mp3 from? It seems to immediately forget which directory I browsed into. Anyone get the same effect? I'm on Slacko53.

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#28 Post by mcewanw »

greengeek wrote:Any way of getting xhippo to remember the last directory that I picked an mp3 from? It seems to immediately forget which directory I browsed into. Anyone get the same effect? I'm on Slacko53.
Not sure what you mean greengeek. Do you mean on closing the program and then executing it again? I've just been dragging and dropping a directory of mp3 files into it.
github mcewanw

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#29 Post by greengeek »

If I run xhippo, rightclick it's "desktop" and navigate to my music folder then click on a song it will happily add it to the playlist.

If I then repeat this process (to choose a second song) it would be nice if it remembered where I was just browsing, but it doesn't. I have to drill down through the directories again /mnt, /sdb3, /archive, /music, /Abba etc

Rather longwinded. (I could grab the whole directory...but I really only want just 5 or so songs)

(yeah, I know I shouldn't be listening to Abba.... :-) )

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#30 Post by mcewanw »

Oh, yes I see what you mean. A common problem with many programs - always starts at home directory (~). I can't see a way of changing that behaviour either. The only workaround I can think of is to create a temp directory for the songs you want (can store the required songs in their by drag and drop as symbolic links to the originals) and then drop that directory into xhippo. You can easily clear the playlist and change the contents of your temp directory thereafter.
github mcewanw

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#31 Post by greengeek »

Thanks mcewanw. Good to know it's not just me...

Also - just discovered a "bug" with PeasyMP3 - while playing through my MP3s it suddenly started to play my flv files as well (which may not always be appropriate... :-) )

Just a heads up in case there's kiddies in the room...

EDIT: Be nice to have two versions: PeasyMP3 (PeasyAudio??) for audio only, and PeasyMedia for all files.

EDIT2: Would it be difficult to make PeasyMP3 work recursively? (My music directory contains maybe 20 individual "loose" songs and the rest are inside subdirectories labelled with the artists name or album name)
Last edited by greengeek on Fri 14 Jun 2013, 20:53, edited 1 time in total.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#32 Post by rcrsn51 »

greengeek wrote:EDIT: Be nice to have two versions: PeasyMP3 (PeasyAudio??) for audio only, and PeasyMedia for all files.
You can do this yourself. Open /usr/sbin/peasymp3 and look at Line 11

Code: Select all

export SKIPLIST="jpg$|png$|pdf$|txt$"
Add any extensions to this list that you want to skip. For example:

Code: Select all

export SKIPLIST="jpg$|png$|pdf$|txt$|flv$|avi$"
Or you could store your adult content some place separate from your music files. :wink:

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#33 Post by greengeek »

rcrsn51 wrote:Or you could store your adult content some place separate from your music files. :wink:
"Adult content"? <cough> Whatever do you mean???

It's just that I have some 911 videos that conspiracy deniers don't like to watch...
:-)

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

Re: controlling mplayer

#34 Post by disciple »

mcewanw wrote:In theory I suppose you should be able to use gnome-mplayer for much of PeasyMP3 functionality, but the version I've tried in Slacko533 seemed to be a bit buggy at folder playing.
If you can come up with a proper bug report, the author is very responsive.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Peasy latest with pause uploaded

#35 Post by mcewanw »

@disciple: yes, if I have a spare moment I may do that eventually - or not since I prefer to use a different program for music playing anyway and have a baby in my fulltime care...


As for PeasyMP3. I have once again added a pause control, retrovol and ogg capability to my copy of the latest version released at this date (version 3-2.7), so uploaded that again at the following link:

http://www.murga-linux.com/puppy/viewto ... 385#708385

Hope I've not made any mistakes in copying the code over again (easier the first time round whilst my mind was actually working on it).

Note I had to reboot for some reason once I installed my version over the top of the original. Probably to do with something else I was doing in parallel though. Program seems to work fine though not I haven't done much testing after having remade these changes for a second time.

I was hoping the PeasyMP3 author might incorporate some of these changes to save having to do them all over again, but that's up to PeasyMP3s author. I may keep track of the releases, but it is a bit of effort adding code in that way. If the changes are wanted then I might just build a different project based on cut-down Pavrecord code to mirror the functionality of PeasyMP3 and xhippo.

Alternatively, to save effort, I might just use xhippo. Now that I have lame and aplay working with that I realise that tempestuous is right about how good it is.
github mcewanw

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#36 Post by disciple »

rcrsn51 wrote:
disciple wrote:... one thing I've always missed in Linux is the "directory player" 1by1.
Me too. That's the point of PeasyMP3. Have you tried it?
disciple wrote:It doesn't automatically progress onto the next directory in the filesystem, does it?
In case I need to clarify:
My understanding is that PeasyMP3 makes a playlist out of all the files in a directory, including (recursively) any subfolders. The same functionality is available in any number of other media players.
1by1 is not based around a playlist. Unless you have the option disabled, 1by1 basically works by automatically searching for the next file to play, when you need it. If you tell it to play a file, when it gets to the end it will then play the next file in the folder. When it gets to the last file in the folder, it will find the next file in the filesystem and play that, even if it didn't exist when you first started.
e.g. if you have a filesystem like this and you tell it to play any file in it, it will play that and then keep on playing down the list, even if some of the files didn't exist at the start.

Code: Select all

/a/a/a.mp3
/a/a/b.mp3
/a/a/c.mp3
/a/b/a.mp3
/a/b/b.mp3
/a/b/c.mp3
/a/c/a.mp3
/a/c/b.mp3
/a/c/c.mp3
/a/a.mp3
/a/b.mp3
/a/c.mp3
/b/a/a.mp3
/b/a/b.mp3
/b/a/c.mp3
/b/b/a.mp3
/b/b/b.mp3
/b/b/c.mp3
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

How to use xhippo as an mp3 music and video player GUI

#37 Post by mcewanw »

Thanks for the xhippo reminder tempestuous, saves me spending time working on or contributing to alternatives at the moment...

How to use xhippo as an mp3 music and video player GUI

using underlying lame, aplay, and mplayer (which are in most Puppies by default I believe):

http://www.murga-linux.com/puppy/viewtopic.php?t=86741
github mcewanw

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#38 Post by tempestuous »

mcewanw,
I see you're refining/improving PeasyMP3, and that's great.

And I see you have just made a new forum thread about configuring xhippo to use suitable back-end applications in modern Puppies. Again, a good initiative, but let me make a few observations:
mcewanw wrote:xhippo can be configured to work with lame, aplay and so on: I just did so. You need to use the g flag in the config script
It sounds like you're piping the output of ffmpeg, and for MP3 files it looks like you're doing a similar "trick" with lame. In both cases I don't think it needs to be as complicated as that - just use the ffplay executable instead.
For video files here is the correct xhippo configuration line (using "avi" filetype as an example)

Code: Select all

type:avi:ffplay -autoexit
And for audio files, just add the "-nodisp" parameter to avoid getting a pointless video window.

Code: Select all

type:mp3:ffplay -autoexit -nodisp
But wait! Mplayer, despite its large binary size, actually has lower CPU utitlisation that ffplay. This is odd, since they both draw upon the same ffmpeg libraries. And it's worth adding the "-really-quiet" parameter to mplayer to avoid filling up your tmp directory. So for MP3 files here is the correct xhippo configuration line -

Code: Select all

type:mp3:mplayer -really-quiet
You can use this same command string for all media file types.

greengeek wrote:Any way of getting xhippo to remember the last directory that I picked an mp3 from?
It's a bit "hacky" but this works - run these commands -

Code: Select all

cd /path/to/my/music/collection
xhippo
Now when you right-click the xhippo window you're in the correct location.
To automate this, you could create a wrapper script, then link the wrapper script to a desktop icon.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#39 Post by 01micko »

It's probably worth noting that I went against Barry's idea of disabling ffplay when compiling ffmpeg. Slacko versions include it, it's only a small binary. As far as I can recall, none of Barry's do.

Code: Select all

# which ffplay
/usr/bin/ffplay
# stat -c %s /usr/bin/ffplay
69088
That said, mplayer is lighter on resources as far as playing music is concerned.
Puppy Linux Blog - contact me for access

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#40 Post by disciple »

But wait! Mplayer, despite its large binary size, actually has lower CPU utitlisation that ffplay. This is odd, since they both draw upon the same ffmpeg libraries.
Could it be that Mplayer is using some sort ot hardware acceleration or something that ffplay isn't?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

Post Reply