Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    11

    interrupt a stream for announcements?

    is there a provision in the cli for temporarily suspending a stream in order to play something else, briefly? my application is for home automation announcements (e.g., caller-id announce, or voice responses to requests made via IR remote).

    i was hoping that the "playlist preview" command might do it, but it looks like it will start the current track from the beginning when it resumes, rather than from where it was interrupted. (aside: what's the purpose of that feature?)

    might i be able to use alarms for this? if i could put my desired audio into an alarm sound-file, and either preview it or have an alarm fire "right now", would that interrupt the current stream, and then let it continue?

    (my players are all squeezeslave -- don't know if that makes a difference.)

    thanks...
    paul

  2. #2
    Senior Member Mnyb's Avatar
    Join Date
    Feb 2006
    Location
    Vństerňs Sweden
    Posts
    16,528
    Quote Originally Posted by pgf View Post
    is there a provision in the cli for temporarily suspending a stream in order to play something else, briefly? my application is for home automation announcements (e.g., caller-id announce, or voice responses to requests made via IR remote).

    i was hoping that the "playlist preview" command might do it, but it looks like it will start the current track from the beginning when it resumes, rather than from where it was interrupted. (aside: what's the purpose of that feature?)

    might i be able to use alarms for this? if i could put my desired audio into an alarm sound-file, and either preview it or have an alarm fire "right now", would that interrupt the current stream, and then let it continue?

    (my players are all squeezeslave -- don't know if that makes a difference.)

    thanks...
    paul
    afaik alarm serves up another playlist and the previous now playing playlist will be gone , I cant program much of anything but i guess your problem is that everything is a playlist to the squeezebox .

    If you use "add next" for the anoucement file or stream (or what the cli eqvavilent is called ) and skip the ongoing track ,you may have to skip again after the announce ifit is a stream
    --------------------------------------------------------------------
    Main hifi: Rasbery PI digi+ MeridianG68J MeridianHD621 MeridianG98DH 2 x MeridianDSP5200 MeridianDSP5200HC 2 xMeridianDSP3100 +Rel Stadium 3 sub.
    Bedroom/Office: Boom
    Loggia: Raspi hifiberry dac + Adams
    Bathroom : Radio (with battery)
    iPad with iPengHD & SqueezePad
    (spares Touch, SB3, reciever ,controller )
    server Intel NUC Esxi VM Linux mint 18 LMS 7.9.2

    http://people.xiph.org/~xiphmont/demo/neil-young.html

  3. #3
    pgf@foxharp.boston.ma.us
    Guest

    interrupt a stream for announcements?

    mnyb wrote:
    >
    > pgf wrote:
    > > is there a provision in the cli for temporarily suspending a stream in
    > > order to play something else, briefly? my application is for home
    > > automation announcements (e.g., caller-id announce, or voice responses
    > > to requests made via IR remote).
    > >
    > > i was hoping that the "playlist preview" command might do it, but it
    > > looks like it will start the current track from the beginning when it
    > > resumes, rather than from where it was interrupted. (aside: what's the
    > > purpose of that feature?)
    > >
    > > might i be able to use alarms for this? if i could put my desired audio
    > > into an alarm sound-file, and either preview it or have an alarm fire
    > > "right now", would that interrupt the current stream, and then let it
    > > continue?
    > >
    > > (my players are all squeezeslave -- don't know if that makes a
    > > difference.)
    > >
    > > thanks...
    > > paul

    >
    > afaik alarm serves up another playlist and the previous now playing
    > playlist will be gone , I cant program much of anything but i guess your


    okay, good to know. scratch alarms, then.

    > problem is that everything is a playlist to the squeezebox .
    >
    > If you use "add next" for the anoucement file or stream (or what the cli
    > eqvavilent is called ) and skip the ongoing track ,you may have to skip
    > again after the announce ifit is a stream


    hmmm. maybe.

    sounds like the answer is, that i really can't do what i want. i guess
    i'll have to figure out how to share the audio device instead, and simply
    mute (or stop and restart) the slimserver stream while an announcement
    is happening.

    paul
    =---------------------
    paul fox, pgf (AT) foxharp (DOT) boston.ma.us (arlington, ma, where it's 31.3 degrees)

  4. #4
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    11,050
    Quote Originally Posted by pgf View Post
    is there a provision in the cli for temporarily suspending a stream in order to play something else, briefly? my application is for home automation announcements (e.g., caller-id announce, or voice responses to requests made via IR remote).

    i was hoping that the "playlist preview" command might do it, but it looks like it will start the current track from the beginning when it resumes, rather than from where it was interrupted. (aside: what's the purpose of that feature?)

    might i be able to use alarms for this? if i could put my desired audio into an alarm sound-file, and either preview it or have an alarm fire "right now", would that interrupt the current stream, and then let it continue?

    (my players are all squeezeslave -- don't know if that makes a difference.)

    thanks...
    paul
    As far as I know there is no built-in support for something like this.
    What you can do is to check the current position before the announcement and then send a CLI command that moves it back to the same position after the announcement.
    Erland Isaksson (My homepage)
    Developer of many plugins/applets

  5. #5
    I have been working on something similar over the last 2 days.

    You CAN do this via the command line interface.

    I use a bash shell script on a raspberry pi to run the commands.

    This one stores the current song position in a variable:

    TRACKPOS=`(echo "playername time ?";echo "exit")|nc x.x.x.x 9090 | awk '{print $3}'`

    player pause
    player save playlist songs
    player play <file>
    player playlist resume songs

    then you restore the song position by:
    (echo "playername time $TRACKPOS";echo "exit")|nc x.x.x.x 9090

    You may need to put in a few "sleep" commands, eps. after the "player play" command.
    I started a thread for the last thing I need: resume playing a randomplay playlist

  6. #6
    Junior Member
    Join Date
    Dec 2012
    Posts
    11
    thanks for following up on this thread! i'll give that a try.

    i guess i'll also need to check that there's actually a playlist playing before going through that sequence.

  7. #7
    Quote Originally Posted by pgf View Post
    thanks for following up on this thread! i'll give that a try.

    i guess i'll also need to check that there's actually a playlist playing before going through that sequence.
    I tried it out, it doesn't matter if there is a current playlist playing or not. If there is not, then it will just save and load an empty playlist. The rest still works.

  8. #8
    Junior Member
    Join Date
    Dec 2012
    Posts
    11
    Quote Originally Posted by sellars View Post
    I tried it out, it doesn't matter if there is a current playlist playing or not. If there is not, then it will just save and load an empty playlist. The rest still works.
    nice. thanks again. i'll follow up here if i learn any other tricks while experimenting.

  9. #9
    Junior Member
    Join Date
    Aug 2013
    Posts
    5
    You might want to check out my thread, "Trying to play a temporary sound and then resume music if it was playing". I think with the details of how I did this which I posted in the thread that you can do what you are trying to do.

    Sean

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •