Request: script to stream music for given amount of time

I'm looking for a bash script (or anything that will get the job done) that will:
-stream music from my favorite internet radio station (ie: di.fm)
-play stream for a given time in increments of 1hr (ie: 1 hr, 3 hrs, etc)
-at the end of the given time, fade out the music then terminate stream after fade out is complete.
-terminate script (or application that is performing these tasks)
Ideally, the script will take in the internet radio station and time as arguments. I have Rhythmbox which I currently use to stream.  I don't care if the script opens applications for use in this process.  Can anyone help me with this?  Or at least get me pointed in the right direction?
PS: I plan on using this as my music to listen to while I'm trying to go to sleep, hence the time limit and fade out.  If the music stopped abruptly I would most likely wake up.
Thanks guys.

I know in mplayer, you can do most of that.
For example, running this from console will play Lounging Sound radio for exactly one hour;
mplayer -endpos 01:00:00 http://67.159.44.146:8002/
I'm not sure about the fade out effect, you might have to Google for that information. I'd recommend the 'mplayer-svn-nogui' package in AUR (or check out the one here) if you decide to go this route.
Oh, you might want to check out MPD too... it could possibly do something like this.
Last edited by Pnevma (2008-07-22 12:56:30)

Similar Messages

  • Script to stop movie for designated amount of time?

    I'm setting up a Flash file that will basically operate as a
    presentation on the site's home page. The swf will load in a
    sequence of movies that the viewer will not have control over.
    Is there a way to stop these external movies for say, 20
    seconds, before it loads in the next one.
    Or should I just put in a "go to next" control for the
    viewer? (really don't want to do this)

    Try this out... I wrote it for just such an occasion
    http://explorinlauren.com/repository/flash/actionscript/using-set-interval-to-pause-timeli ne.html

  • How to generate a continuous sine wave for a given amount of time

    I am trying to output a continuous sine wave for a speaker, but I am having difficulty making it continuous rather than looping the signal for a given amount of time, which causes discontinuities. There is a VI in the Labview examples titles Continous Generation, but it produces a square wave. Is there a way to adapt this VI such that the amplitude and frequency can be used as inputs to create a sine wave?

    I found a VI that ships with labview(7.0)called continuous sound output. the output of this is a sine wave or you can change it to whatever you want.
    Sorry cannot help more
    Joe
    Joe.
    "NOTHING IS EVER EASY"

  • Is there a way to create a custom screensaver with pics/slides that display for different amounts of time?

    Is there a way to create a custom screensaver with pics/slides that display for different amounts of time? Or even add a "video slide" into the screensaver?
    My business has 3 TVs displayed in our lobby, each with its own apple TV and they are all linked to the same photo stream. Currently the Atv screensaver displays the photostream pictures of our products for the default 3 seconds. We just added pics/slides that now display messages and useful info for our customers but I want that info to be displayed for a longer period of time than the pictures to give people a chance to read it.
    I tried using flickr and powerpoint as a work around but no luck.  I created a slide in powerpoint with play length of 15 secs and saved it as a wmv file.  I added that file to a "screensaver" set in flickr and pointed the Atv screensaver to that flickr set.  It still displays everything, pics and the wmv file at the default 3 sec.
    I know I can increase the duration of all pics in the screensaver to display for longer but the goal is to have the pics display at 3 secs and the info slides to display at 15 secs.

    Welcome to the Apple Community.
    No that's not possible.
    If you have any suggestions that you think might enhance the Apple TV you can send Apple your feedback here 

  • Playing jpeg pictures for different amount of time

    hello everyone.
    i'm new to jmf and i have been reading a bit about it. so i tried the sample code at: http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/JpegImagesToMovie.java (THIS WAS VERY HELPFUL)
    this program displays each image for 1 second each.
    now my problem is, i want to display these pictures for different amount of time... for example: display pic1 for 1 second, then display pic2 for 3 sec and so on.
    can anyone help me please. THANKS

    >
    i'm new to jmf ..>The [JMF forum|http://forums.sun.com/forum.jspa?forumID=28] is the best place to ask JMF related questions, but I am guessing you are also new to Java, and to programming, so this forum might be best for the moment.
    >
    ..and i have been reading a bit about it. so i tried the sample code at: http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/JpegImagesToMovie.java (THIS WAS VERY HELPFUL)
    this program displays each image for 1 second each.
    now my problem is, i want to display these pictures for different amount of time... for example: display pic1 for 1 second, then display pic2 for 3 sec and so on.>Well.. given a run of [JpegImagesToMovie.java|http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/JpegImagesToMovie.java ] might go..
    java JpegImagesToMovie -w 400 -h  300 -f 1
      -o the.mov pic1.jpg pic2.jpg pic3.jpg..you might instead try..
    java JpegImagesToMovie -w 400 -h  300 -f 1
      -o the.mov pic1.jpg pic2.jpg pic2.jpg pic2.jpg pic3.jpg
    Lines broken for clarity.  Instead have command all in one line.
    This simply repeats the second frame, three times. The .MOV format might 'optimize away' the second and third frame from the final file, but I would not count on it.
    Of course, a far better way to animate images (with transition effects, full control over time, and all the bells and whistles) is to load the images into memory and create the slide show using the Java 2D abilities, mostly found in the Graphics class.

  • Writing a file for prescribed amount of time in a while loop after the triggering condition is met

    Hello Guys,
    I am trying to program an application in which if the trigger condition is met it should start to write the file.
    I was able to do that, but if I want it to be written for certain amount of time, and once the trigger condition is met, it should continue to write the files for prescribed amount of time. I was not able to do this. The file name should also be updated accordingly.
    I tried to with some options by keeping the creation of the file outside of the loop, if I do that then if the trigger condition is not met it will stop writing and I dont want that, as once the trigger condition is met it should be true thereafter.
    So I cant keep any thing outside the while loop, bcaz then it checks the condition of the shift register for the trigger and I have it as a false constant.
    I am attaching my application which is kind of mess and I have written in the application where I am having problems. For every iteration of while loop it makes a new file, and i dont want that, I want to write specific amount of time data to the each file.
    Please take a look at my code and help me in solving the problem. Any insights and examples on how to do this thing will be a relief to me.
    Thanks in advance.
    Regards,
    Nitin
    Attachments:
    PXI_4462_Sync_and_Stream_trigger.zip ‏192 KB

    what i am saying is to keep track of how much data you have written and whenever you need to make a new file you make 1.
    here is a vi that i just made that should show you. let me know if you need any help understanding it.
    Attachments:
    new file exemple.vi.zip ‏21 KB

  • Wait for undefined amount of time

    Hello All,
    I have a requirement, where in I would want my activity in the workflow to wait for an indefinite amount of time. Then when a certain activity occurs, I would like to complete the 'waiting' activity.
    So lets say I have the following process with 2 activities(A and B)
    ----------> A ----------> B(wait for undefined amount of time)------------->End
    B needs to wait for some time, which I do not know.
    Then when another event( PL/SQL activity) occurs, I need the event to trigger of the waiting activity B, to completion.
    How can I acheive this?
    Thanks in advance.
    PHK

    Luiz,
    Lets say I have the following:
    -------->A---------->B(needs to wait)-----No------>D----> END
    \ Yes
    C-------------->END
    B is the activity which needs to wait. It has a PL/SQL function assciated with it.Lets say I have a result type of YES/NO associated with activity B. As soon as the workflow engine encounters activity B, it will execute the function associated with it. Lets the function ends with a result_out => YES, then immediatly C will be executed.
    So setting a result type will not help. I need to wait at step 'B'
    Regards,
    PHK.

  • Streaming music for multiple rooms of a house

    Hi all,
    I have an iBook G3. My question is, I want to stream music from my iBook to multiple rooms without having a lot of latency. The Airport Express (unless I'm wrong) can only stream one room at a time (I need more than one to be able to stream). I want to get the whole house wired for having Christmas music play throughout the house. If you have any products let me know. Thanks!
    iBook G3 500 MHz, 576 MB Ram   Mac OS X (10.4.3)   Beige G3 266 MHz, 40 GB IBM Hard Drive, External SuperDrive

    Hi Joshua,
    there are two commercial solutions that do want you want ('though they'll cost you ) the Squeezebox and Sonos Digital Music Systems.
    -Petra

  • Sound cuts out after any given amount of time, only way to turn back on is to reboot.

    For reference, I am using a fully up-to-date mid-2012 model rMBP. Attached to my MacBook via USB I also have an M-Audio KeyStation 49i, which is where I have my headphones plugged in (probably not related in any way, but just noting this).
    I first encountered this issue while using Chrome and listening to music on SoundCloud with Garageband open after the last Mavericks update yesterday. I initially thought it was a Chrome bug, and in doing some research, I found that other Chrome users were having the same issue as me, but it was related to PepperFlash (a version of the standard Flash player), and disabling it in Chrome Canary fixed the issue for them.
    Unfortunately, it did not fix the issue for me, but I have refrained from using Chrome since then and stuck to Safari to ensure that it's not two issues with the same outcome.
    Then I stumbled across all of the Mavericks users that are having sound problems; anything from crackling/popping to not working at all. It seemed, though, that everyone that was having the sound cut out for them entirely were not only having this happen after their laptops came back from sleep mode (which is not the case for me), but were able to fix it by restarting Coreaudio[d] or -- if they had been using the headphone jack on their Macs -- they just had to plug it in again and take it back out. Neither of these worked or were applicable to my situation. Some were able to get it working again by resetting the PRAM/NVRAM, and a few others seemed to be able to bypass the issue by using Soundflower, but neither of these solutions worked for me either. The only way I can get sound to work again is to restart my computer entirely.
    After doing so, I am only able to listen to audio for a certain amount of time. It seems to vary depending on how much memory the task is taking up. Like I'll be able to listen to a track or two on SoundCloud, or attempt to record into Garageband for five minutes or so. If I'm in a Garageband project that already has a lot of tracks, I'll be lucky if I can even get through a few seconds before it cuts out entirely. There are very quiet crackling/pop sounds every once and awhile, but it is hard for me to distinguish if that is just the natural state of the hardware I am using or if it is related to background system sounds.
    I'm at wit's end trying to figure out what the problem is, mostly because there are so many others with similar issues and varying hardware/software setups that it's hard to track down exactly what my own situation is.
    I'd like to know where I should be exporting any error logs from so that someone can take a look at this issue.
    Thank you.

    After doing some additional testing, I was able to get the sound working again without rebooting by:
    1. Unplugging the MIDI device.
    2. Resetting the audio input and output to "built-in".
    3. Plugging back in the MIDI device.
    4. Changing the audio input and output back to the MIDI device.
    Still, though, the sound only lasts for a little while, and there doesn't seem to be anything indicating how or why it stops.

  • ITunes movies - 'freeze' for same amount of time I can play??..

    I have a frequent problem with iTunes movies - when I download one from the Store it stops all the time.  I can usually restart it by pressing pause and then play, although sometimes I have to go out of the movie altogether then restart and fast forward to where i was. It is incredibly irritating as you can imagine.  Any ideas?  The amount of time I get to watch the movie seems to relate to the amount of time I have before it of waiting.  Eg if it stops and I restart instantly I only get a minute or so of movie, whereas if I stop the movie and only restart it after five minutes then I seem to get at least five minutes before it stops again.
    So grateful for any help..

    I have a frequent problem with iTunes movies - when I download one from the Store it stops all the time.  I can usually restart it by pressing pause and then play, although sometimes I have to go out of the movie altogether then restart and fast forward to where i was. It is incredibly irritating as you can imagine.  Any ideas?  The amount of time I get to watch the movie seems to relate to the amount of time I have before it of waiting.  Eg if it stops and I restart instantly I only get a minute or so of movie, whereas if I stop the movie and only restart it after five minutes then I seem to get at least five minutes before it stops again.
    So grateful for any help..

  • Perform each task for certain amount of time

    Hey,
    The program I'm trying to create is a very linear one and involves performing three different processes after one another, each for a set amount of time.
    I originally tried using case statements and timers to do this, but everything got very messy very quickly. I then looked at sequence structures however have read some bad things about them.
    Could anyone point me in the best direction to achive this?
    Thanks,
    Sam.

    Sam_R, Yamaeda is right. Sometimes things are so simple that you do not need a state machine. But sometimes you end up adding features to your simple little program and it ends up growing out of control. Trust me
    There are a million examples of state machines out there. This makes a million and one. It does not address the part of your question about performing an action for a certain amount of time. I wanted to keep it as simple as possible while also demonstrating programmatically determining the next state and error handling.
    I don't mean to sound condescending with this basic example. But I know there was a time when it seemed like advanced stuff to me. Hopefully someone will find this useful.
    =====================
    LabVIEW 2012
    Attachments:
    State Machine.vi ‏12 KB

  • Writing binary file for fixed amount of time

    Hello, I'm trying to write a binary file of multiple channels for a fixed amount of time before I perform my analysis. Does anyone know the best way to accomplish this?

    Here is an example of one way to do what I think you are trying to do. There may be a more elegant way of doing it, but this is pretty simple and straight-forward. It basically writes a 5-integer array for 5 seconds and then stops. Let me know if you have any questions.
    Attachments:
    timed write.vi ‏27 KB

  • Display for variable amount of time?

    Any thoughts on how I might accomplish the following:
    I need to be able to display a graphic (or video) for a variable amount of time in captivate.  This will be for a quiz type slide.  The user will only have a limited amount of time to view a graphic, and then must answer a question.  The graphic will only be displayed for fractions of a second ie. 1/16 to a half second.  The user must be able to adjust the time, so that they can go from slow transitions to faster transitions (for training purposes).
    My initial thoughts were:
    Is there a me
    1) Collect and set a variable in Captivate for the time to wait (user selects at run time), pass that variables value to a flash object and play the content for the specified length of time on the Captivate slide.
    or
    2) Create a new question type widget and define the widget parameters (time to display, image file to use, etc..), but will I be able to change a parameter at run time to allow the user to define the length of time to display???
    or
    3) Create the whole quiz in Flash, then tackle transmiting the quiz score/interactions back to captivate?  I don't have eLearning suite, so I dont have the question extras as well.
    I would prefer to do as much in captivate for speed and I am most familiar with it.  I would prefer to do as little in Flash as possible since I don't know it as well.
    Suggestions???

    Sorry I lost part of the post:
    Is there a method in Captivate to wait a period of time, and if so just set a conditional loop to show an object, wait the time, and then hide?  I am figuring that there is not, so my three other plans of attack...

  • Computer hibernates automatically after sleeping for X amount of time.

    I recently bought a VPS and have been sleeping my old personal server when it's not in use.  However, I find that after putting it to sleep, it'll actually go into hibernate after some amount of time.   I would prefer this *not* to happen so that I could easily wake the machine with WOL.  Was hoping someone could point me in the right direction as to what might be causing this.
    I have the acpid and cpufreq daemons which might affect this.  Both of these are setup with the default configurations.  I have laptop mode installed but *not* in the daemons array/running.
    In order to put the machine to sleep, I am simply using "pm-suspend".   Does the default pm-suspend script cause the machine to hibernate after a specified time?  Or, perhaps a script that comes with laptop-mode that is being run on suspend?
    Appreciate the help in tracking this down!

    You can do it with a time schedule in System Preferences > Energy Saver > Schedule.. button.
    Regards

  • When I use my computer for any amount of time all of a sudden the fan starts up full blast and everything freezes

    Nothing works after this happens its happened 3 times now, the first I just forced shut down and re started, the second I force shut down and left it off for the night, the third time I let it run like that for a bit to see if it would control itself but after a small amount of time I forced shut it down again.

    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Enter "BOOT_TIME" (without the quotes) in the search box. Note the timestamps of those log messages, which refer to the times when the system was booted. Now clear the search box and scroll back in the log to the last boot time after  you had the problem. Select the messages logged before the boot, while the system was unresponsive or was failing to shut down. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message (command-V). Please include the BOOT_TIME message at the end of the log extract.
    If there are runs of repeated messages, post only one example of each. Don’t post many repetitions of the same message.
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    Still in Console, look under System Diagnostic Reports for crash or panic logs, and post the entire contents of the most recent one, if any. In the interest of privacy, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if present (it may not be.) Please don’t post any other kind of report — it will be very long and not helpful.

Maybe you are looking for