Super simple bash music player

I've got this little script that continuously plays random songs:
#!/bin/sh
songs=(~/music/*/*/*)
total=${#songs[@]}
while true
do
song=${songs[$RANDOM%$total]}
oggdec "$song" -o- | aplay -q
done
I'd like to be able to skip a song and go to the next, aside from a ctrl-c and restart. Suggestions?
Last edited by Odysseus (2009-11-21 09:04:09)

If the script isn't to be run in background then may be you can keep the while loop in background, and use read to get a response,e.g. if it is "n" then terminate the while loop and restart with array index increased by 1
But if you'd like to run it in the background, you can use trapping of signals may be
Last edited by djszapi (2009-11-21 17:36:38)

Similar Messages

  • Music Player Stopped Working

    I use the simple Quicktime Music Player to play mp3 music on my website.
    However, when I was prompted to update Quicktime, the music player quit working. I think I have messed up the MIME association.
    How do I fix that?
    Thanks,

    It could be corrupted data on the memory card that's causing this.
    Does it behave in the same way if you remove the memory card?
    If it works ok without the card you need to format the card and reload the music and try again.
    If it still fails to work try a factory reset from the settings menu. If that fails then you will have to take it to a nokia care point for repair.
    Care points/service centres and repair info:
    UK • Europe • Asia-Pacific • USA •
    Canada • Middle East and Africa
    Elsewhere: Click here, select your country, go to the support section, then select repair.
    Message Edited by psychomania on 13-Aug-2008 02:20 PM

  • [Solved] Looking for a simple music player

    Hello there,
    I'm looking for a music player for a box I'm currently building. I only need it to have a GUI, playlist support and random playing. I've thought of xmms2, but the standard package comes without GUI and I haven't found any clients with random playing.
    Any ideas?
    Thanks!
    Last edited by Surgat_ (2009-10-21 20:37:46)

    as simple as they get:
    xmms: (not xmms2!)
    audacious:
    audacious is a form of bmp, which is a fork of xmms... they're all basicly the same, audacious is more up to date though.

  • A simple question about mp3's in a Flash music player

    I have a music player for a Flash site that I'm working on that plays 3 mp3's.  Right now it just has some short sound loops, but I find them repetitive and annoying.  I'd like to replace them with mp3's of full songs.  Is it ok to add 3 mp3's of songs that are like 3 minutes long and are 128 kbps or will those be too big of files?  The mp3's are all between 2 and 3 mpgs.  Is it better to try to find ones at say 64 kbps?  Or is there a way to bump them down to a smaller size just for the player but still get decent sound quality?
    Thanks!

    Valeriy,
    Please provide some more information about the technologies you are using to build your application in order to get some appropriate help.
    For example, if you are using ADF BC/ADF Faces, I will say, "please read section 25.8 of the ADF Developer's Guide for Forms/4GL Developers," which describes how to do this using those technologies.
    Obviously, if you're not using ADF BC, then it's not much help... so... help us help you; what technologies are you using.
    John

  • [solved] command line music player

    Hi,
    i'm looking for a very simple command line music player like mpg123 but with a server option like mocp/mpd.
    Other than mocp or mpd i want it for playing files on-the-fly. Like browsing around and playing files i see in the current directory, queueing them, maybe with a curses interface like ncmpc.
    As far as i know, mpg123 can't queue and doesn't run in the background per default. mocp on the other hand comes very close but i don't think it can play files out of the current working directory like i want it.
    Do you know a tool that fits my description?
    Thanks in advance,
    demian
    Last edited by demian (2010-06-01 18:21:05)

    Runiq wrote:
    brisbin33 wrote:
    fwiw, i have a script i call playnow which accepts a file path and plays it through mpd.  i use it for one-off downloaded content or whatever.  it just adds it to a temp folder, quickly updates the db, adds the temp folder to the current playlist (queuing) and plays it.
    it's been working well for me.  i also hear mpd accepts the file:/// uri scheme which kinda takes care of this usage case too.
    As far as I know, MPD's database is updated automatically via inotify as soon as a file is added, so I think you don't even need to update before playing.
    sounds great in theory, but i'm not so sure about in practice.
    for inotify to pick up the new file(s) and mpd to update itself all between bash executing `ln -s` and `mpc add` would be... impressive.  calling `mpc --wait update` manually means i only wait exactly as long as the update requires.
    thanks for the advice though, maybe i'll test it out and see.

  • Looking for a new music player

    Hey guys. I just installed Arch and everything's looking great, but I haven't picked a music player yet.
    I want something extremely light and simple, using GTK+. I just want to make a playlist and play it. I don't want uber-advanced media collection management and iPod support and Audioscrobbling and whatnot. And no KDE/Qt apps either. Most importantly, I want it to be able to run completely from the tray.
    So, Archers: any ideas?

    Well, is controlling Audacious from the tray all that... needed?
    I use Global Hotkeys and have quite a few bindings set up. They work surprisingly well.
    The list as it appears in the hotkey editor window:
    Previous Track: Control + Alt + Prior (PgUp)
    Play: Control + Alt + Return
    Pause/Resume: Pause
    Stop: Control + Alt + End
    Next Tracks: Control + Alt + Next (PgDn)
    Forward 5 seconds: Control + Alt + Right
    Rewind 5 seconds: Control + Alt + Left
    Volume Up: Control + Alt + Up
    Volume Down: Control + Alt + Down
    Pause/Resume: Control + Alt + Insert
    Stop: Control + Shift + F11
    Pause/Resume: Control + Shift + F12
    Next Track: Control + Shift + F10
    Forward 5 seconds: Control + Shift + F6
    Rewind 5 seconds: Control + Shift + F5
    Previous Track: Control + Shift + F9
    Toggle Player Windows: Super + e
    -dav7

  • I just want a music player

    It seems there are so many problems with itunes the "Advice People" can't keep up .
    I don't use an iPod or buy music from the store .
    I got iTunes when it was just a cool music player and that's all I want . With every new version there seems to be nothing but problems and now my version is so old there's no documentation available for it .
    Does anybody know of another player without all the iTunes baggage ?
    Powerbook   Mac OS X (10.4.6)   Panther eMac

    Bobsax
    You know, the only people who come to the fora are
    people who have problems, and the occasional one who
    is willing to offer help. So, judging anything by
    what you see here is like going to your local
    Emergency Room to assess the health of the Community.
    Good point.
    For what it's worth, I have successfully updated
    iTunes all the way from when it was first released
    without a single hitch any time. I have a 100GB
    library on an external HD, three iPods synced to it,
    Album Art, the whole nine yards. The only problem
    I've ever had was when I accidently deleted
    the Library. And then deleted the backup. Learned a
    lot about File Recovery.
    It seems the library system is a major problem with many users and I suspect it has something to do with ipods and the music store and DRM and anything to do with copying music . Like why can't I import my mp3 backup discs directly into iTunes ? I know there are ways around this , that seems to be the way everything is in iTunes and I imagine with video and radio it's twice as complicated . I could probably fix things if I had access to 4.7 articles . What's that about ? Is it to force you to upgrade ?
    Some people have genuine problems on these boards, a
    lot more have issues that can be resolved by reading
    the Help file - ideally before trying
    something. But most people who have installed iTunes
    have no problems at all.
    That said, if you're looking for a simple mp3 player,
    do a search on http://www.macupdate.com using mp3
    player as your search term. It'll give more than 50
    options.
    The problem with that is most searches come up with little mp3 devices like the ipod .
    I found one player (or perhaps juck-box that I may try called AUDIONhttp://www.panic.com/audion/ >
    Regards
    TD
    Thank you for your time TD . I appreciate your help .
    bob
    Powerbook   Mac OS X (10.4.6)   Panther eMac

  • Looking for a decent music player

    I know there is a lot of similar topics on forum, but no one did not respond to my question.
    So far I have tried Exaile, Rhytmbox, Pragha, Decibel, Goggles, ... and so on.
    They are all good players but have some critical flaws.
    Exaile is maybe the best of them, but it is slow with large collections.
    Pragha is fast and light but does not support pulse and multimedia keys wont work with it.
    Decibel is next best thing after Exaile.
    Goggles is fast, but ugly, media keys wont work, no pulse support and its GUI is confusing.
    I have even tried mpd + GUI, but such option is just too complicated to setup for simple music player.
    Okay, this is my personal opinion. What do you think?
    I just need player with ease of use of Exaile but faster with large music collections.

    I'd suggest you buy a faster computer with lots of memory and keep using exaile.
    Regarding GMM:
    1) media keys: we try to grab the usual XF86AudioPlay multimedia keys. If they don't work, it usually means they're already grabbed by some other application or desktop environment (I noticed this with gnome on a ubuntu installation). In case of the desktop environment, remove the default keybindings for those specific keys. Another case it might fail if the multimedia keys don't have the usual XF86Audio* keycode assigned to them.
    2) For pulse support you need a pulseaudio plugin for xine. Either file a bugreport with Arch to enable the building of the plugin, or create your own custom xine package.
    3) I'm always happy to hear suggestions to make the GUI less confusing.

  • I'm looking for a music player with the following features:

    Hi everyone,
    I'm setting up a linux desktop for the first time. I'd like some directions on finding a music player. Here are my criteria, in order of importance:
      - Can play (at least) ogg, mp3 and wav
      - Prefers a 'playlist approach' (m3u) to a 'media library' approach
      - Can play songs without breaks in-between
      - Fast startup
      - Simple interface (ex. VLC beats mplayer)
    My window manager is pekwm. This is for usability reasons, not performance reasons - my comp. can handle all the bells and whistles you throw at it (actually, I tried with my doorbell, but I wouldn't recommend with the church bell). (sorry for the bad humour). Crazy visualisations and features whose sole purposes are to eat up CPU cycles are O.K.
    Good support for keyboard would be appreciated - I am a pekwm user.
    So what have you got?

    MPD rocks, runs here for months without major problems.
    The client side is very flexible, you can choose many players:
    http://www.musicpd.org/clients.shtml
    For X, for console, etc..
    Edit:
    MPD supports Icecast also, to create streams.
    Last edited by mephisto (2007-05-15 14:00:36)

  • How? loading seperate music player .swf into main site prob.

    hey all!
    Ok something that I still don't really understand, have tried
    to modify afew flas but with no luck.
    Anyhow to the point. I have a main fla file with all my
    content in it and a litlte music player that plays 3 to 4 external
    swfs with music &animated LEDs in it. Anyways right now the
    music player itself is built into my main fla file. I would like to
    move the player a little bit so its coordinates change.However
    obviously when i do this and test movie the external music swfs
    that load have little LED moving animations and the 2 files just
    dont match up, so they load into the wrong area. I also tried to
    move the LED elements exactly the same amount as i did with changes
    in the main fla in moving the music player graphics but still not
    working. Do you think these files are working with "tell
    targetting" or? Im sorry im awful with code so..
    Any good and simple tutorials for a numb nut like me would be
    appreciated on this topic so i can understand whats really going on
    here. Normal logic doesnt seem to be getting me all that far.
    Tks!

    ahh thanks Jeff i guess i would say for nuthin.
    Hopefully someone else can give me a litte bit more to go on
    then that!

  • Samsung Continuum Music Player- 5.1 Channel error message

    I have a Samsung Continuum.  Recently, when I use the Music Player application, when I press the 5.1 stereo sound I get an error message that states "5.1 channel can only be activated when sound effects are off."  I have no idea what sound effects it is talking about nor how to turn them off.
    Little help?!

    No, no, the headphones work fine elsewhere.
    I know of no simple electrical reason why specific things like dialogue would be cleanly squelched while background music would remain loud. I find it highly unlikely that it would be due to some problem with the wires---if it was, engineers would manufacture bad wires to perform blind source separation.
    The problem is not a mere reversal of channels, but that when the headphones are plugged in the dialog vanishes. I am assuming that there is some bogus default assignment of 5.1 channels that I am unable to change. If you'd like, I can retry with another set of headphones.

  • New music player not satisfactory no eas of use an...

    Music Player for Symbian^3 Version 16.10.38.
    Device details Nokia N8 OS Symbian Anna, Software Version 022.014(.356.02=Custom)
    There was a time that I was telling friends that now cell phones are equipped with all the best features when it comes to music also. But that was thing of the past.
    1. Artist & Albums Menu. No Separate selection for each available.
    a. Artist:
    How it is: Artist names are shown with album names.
    Problem: If one had to play all songs of (single) desired artist, he can’t as he doesn’t get “PLAY ALL SONGS” option in that.
    How it should be: Type or scroll to the desired artist name, tab (open) it then you will find out options as “Play all songs” or “Play Album (named separately as XXX, XYZ)”. Previous Media Players had that option.
    b. Albums:
    How it is: As explained in Artist menu.
    Problem: I have albums which are multi artists (especially Indian movie songs which are mostly various artists) so if one had to listen to that complete album, he simply can’t.
    How it should be: As explained above for artists. Previous Media Players had that option.
    2. No type tool available to search in desired fields.
    How it is: The most important thing, the typing tool is unavailable,
    Problem: If one have huge music collection and have to search for song either by artist, album, genre, or by all songs option, the only way is to scroll, while scrolling he is guided by alphabets but still it not powerful tool.
    How it should be: It’s easy to find if one just type the first few alphabets (of first or any word in the field) works as filter, whatever you typed remains on screen the rest hides. Previous Media Players had these options.
    3. Missing Music Composer Menu.
    As these options were available in older phone’s media players like Nokia N95, N73 etc but in new once they are missing, Changing in manifestation is good, adding new and attractive features is great, improvement in ease of use is best but eliminating power features is doing something which is equal to downgrade to Stone Age............ I don't think so people will appreciate.
    4. Custom Equalizer Settings.
    How it is: There few selective factory presets for the equalizer.
    Problem: There are millions of Genres Worldwide and not every part of the world matches the music presets they stored in device and most of time people match the sound on their Audio devices (Car Stereo, Home and other) so they need to edit the equalizer for the best optimum sound quality.
    How it should be: As in older devices had and one can change and save his own setting.
    5. Expecting to add more menus: Suggestions for more menus (like year, mood etc) will be greatest things you will do.
    Who will go and buy a separate device just for music if he has all these features supported by his cell phone specially when the manufacturer claims that it have music player inside.
    People don’t have to stop on highways or stop skating for a while just to select the next song, allow people to go by several options.
    In one simple line to explain, keep all the options of older music player, just change the display styles to new one. Add the suggestions.

    Yep as I said in my post tried that obviously aswell as ...  well, the other things i mentioned in my posting. 
    Now does anyone have any ideas?

  • N97 Music Player

    Is there a better / alternative music player available anywhere for the N97? The default player is poor in my opinion - the player I had on my 2 year old Sony W960 was way ahead of this Nokia product.
    Simple things like being able to hide artists associated with compilations seems to be missing.

    I agree with rapid, poor sound compared to my last SE 'phone. Good high end but the middle is weak and the bass lacks any puch whatsoever. And those earphones? A 'phone that costs so much and a budget of 7 pence for them? Good grief.
    Nokia: do yourselves a favour - go and spend a few quid on a cheap Sony 'phone and have a look at how the music should be done on your "market leading entertainment device".
    Sony: here's an opportunity for you - port some of your music player software to S60 v5, sell it in the Ovi and you'll have a stream of punters. In fact, since the upcoming Satio / Idou / whatever-it's-called-this-week is S60 v5, and I'm assuming you'll have put more than 10 minutes though into the music player on the thing, let's just have that software. Thanks.
    I do like most things about this 'phone and I expect the irritating bugs will get ironed out in due course, but it's a shame it had to be so disappointing out of the box.

  • Lightweight qt music player?

    i'm looking for a simple, fast, lightweight qt music player, basically something like foobar2000. i've tried qmmp, but it scans my music directory on startup and takes an exceedingly long time to load. at the moment, i'm using juk, but it's buggy (slow startup, custom shortcuts don't work, etc.) and development seems to have halted.
    of course, if there are no good options, i suppose i could go with a console-based player like moc or cmus. one question: is it possible to create a shortcut to load a player like moc or cmus?
    thanks!

    Dheart wrote:When I migrated from win 4 years ago the thing I missed the most was foobar2000. Unfortunately the only way to use foobar under linux is via wine (heard that recent versions did miracles with it, perfect sound quality etc.)
    I've settled with mpd + sonata. It's not that much of a feature rich but it gives you basic music player (really lightweight) easily managed playlists and lyrics + cover art fetcher, even a tag edtior.
    actually, i used foobar2000 in wine for a while, but these days i'd rather use native linux applications.
    EDIT:
    Whoops didn't see the qt requirement.
    You could chose another mpd frontend and also the mocp shortcut is easy to create. Regardless of the DE you're using just create new shortcut and check the "run in terminal" checkbox.
    awesome, just what i wanted to know.
    i thought about mpd. i had some trouble getting it to work before, but i may take another look.
    teh wrote:And minirok: http://www.kde-apps.org/content/show.php?content=65683
    i forgot to mention that i had already tried minirok, but it wasn't quite what i wanted.
    jdarnold wrote:
    Some ligh(er)tweight music players to take a look at:
    guayadeque - http://aur.archlinux.org/packages.php?ID=26682
    Goggles Music Manager - http://aur.archlinux.org/packages.php?ID=26744
    thanks. though they're not qt, i'll check those out.
    Mikko777 wrote:
    Oh how i'd like to see foobar ported to QT
    but there seems to be lots and lots of players tho (its _too_ easy to code music players with phonon and qt)
    http://qt-apps.org/index.php?xcontentmode=4220
    there are a lot of different players, but many of them don't seem mature.
    edit: i actually just tried qmmp again and so far, it seems perfect for my needs. loads quickly, light, and simple.
    Last edited by anti-destin (2010-01-12 04:36:28)

  • Wireless music player with Time Capsule :advice sought

    Hi,
    All my music files in my iTunes library are stored on my Time Capsule.
    I would like to purchase a wireless music player (Squeezebox or similar, not Mac TV) that could directly access and play the music stored on my Time Capsule, without the need for Mac Book to be switched on. From the few wireless music players I have looked at, I get the impression (possibly false) that I would need the music player's client software installed on the Mac Book to serve the music to the player, which implies that the Mac Book needs to be switched on when the music player is in use (correct/false??)
    Can any one please give me some advice here? Is my understanding correct? Is there a simple way to configure my wireless network to allow a music player to play files directly from the Time Capsule? Can you recommend a particular music player that would allow me to do this?

    I would expect exactly what you are getting.
    Wireless is not going to transfer real world speeds higher than about link speed divided by 3, maybe even 4.
    Find your link speed. Hold down the option key and click the wireless fan in the top menu area.
    Take the transmit rate and divide by 3..
    You should realise that wireless is limited by Apple to 130Mbps at 2.4ghz although in newer equipment you can achieve 217Mbps.
    For 5ghz the speed will be 450Mbps in the same room but drops off quickly.. the above shot is with the TC in the next room.. max link speed dropped from 450 to 162 as drop off at 5ghz is very rapid.

Maybe you are looking for

  • IOS 8.1 Music app not allowing search by artist

    On my iPhone 4S, I usually search music by artist. Since the update to 8.1, my phone no longer responds to searching through the alphabet down the RHS for Artist. It does for the Category Songs , but not for Artists. Have others experienced this?  Is

  • How do i install indesign with windows 8 on a pc

    how do i unstal indesign with windows 8 on a pc?

  • How to open pdf files on computer while getting error message?

    I can not open pdfs on my computer that I was priorly able to open. This includes files I have scanned in, email attachments, and files I have converted to pdfs. I keep getting an error message in Adobe saying that it is not a supported file type or

  • HT1541 My mistake regarding an itunes gift - can it be rectified?

    Yesterday I bought an itunes gift for my son in Saudi. As he hadn't received it I looked again at my order and realised I had typed the wrong email address - homail instead of hotmail. Is there anything I can do to get it sent to the correct email ad

  • Mobile Sales Customizing

    Hi, Can anyone please tell me where I can find some useful information on Mobile Sales Customizing? I'm currently looking in Mobile Sales 5.0 SP07 to create an activity, but I do not seem to get the dropdowns allright, and I receive some errors in re