Announcement

Collapse
No announcement yet.

Want to create event to play one song, then repeat a second

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Want to create event to play one song, then repeat a second

    Here's what I want to accomplish within an event:

    - clear queue
    - set volume
    - set repeat to no
    - play SONG #1
    - wait until SONG #1 finishes
    - clear queue
    - set volume
    - set repeat to yes
    - play SONG #2
    - repeat SONG #2 forever

    It's that wait until SONG #1 finishes bit that I haven't figured out how to do. There isn't a way that I can see to 'wait until the song finishes'. I can set song #2 to play 'next', so it plays when the first song is done, but then I can't clear the queue and set other settings until the first song finishes. I guess I could in theory set a second event that trips when the other song plays and finishes (I think), but I'm going to have a bunch of these events so I don't really want two for each event. I don't have other ideas. Suggestions?

    Paul

    #2
    Originally posted by paul View Post
    Here's what I want to accomplish within an event:

    - clear queue
    - set volume
    - set repeat to no
    - play SONG #1
    - wait until SONG #1 finishes
    - clear queue
    - set volume
    - set repeat to yes
    - play SONG #2
    - repeat SONG #2 forever

    It's that wait until SONG #1 finishes bit that I haven't figured out how to do. There isn't a way that I can see to 'wait until the song finishes'. I can set song #2 to play 'next', so it plays when the first song is done, but then I can't clear the queue and set other settings until the first song finishes. I guess I could in theory set a second event that trips when the other song plays and finishes (I think), but I'm going to have a bunch of these events so I don't really want two for each event. I don't have other ideas. Suggestions?

    Paul
    Hi Paul, did you ever figure out how to make this work? Maybe if you can explain what song 1 is and what song 2 is, maybe we can think of other ways to accomplish what you are looking for.

    Only way I can see is to create a virtual device.
    Event 1 would set the virtual device and play song 1
    Event 2 would trigger on stop or track change, check for the virtual device being set and if so, reset the virtual device and play song 2.

    Dirk

    Comment


      #3
      Originally posted by dcorsus View Post
      Hi Paul, did you ever figure out how to make this work? Maybe if you can explain what song 1 is and what song 2 is, maybe we can think of other ways to accomplish what you are looking for.

      Only way I can see is to create a virtual device.
      Event 1 would set the virtual device and play song 1
      Event 2 would trigger on stop or track change, check for the virtual device being set and if so, reset the virtual device and play song 2.

      Dirk
      Hi there, I made it work, but indeed I had to use two events to accomplish it, which I was trying to avoid, but oh well.

      What I have is a bunch of events that play a different guided meditation for my kids when going to sleep, which they really like. Once that's finished, I have it switch to white noise, which it then repeats forever (10 min white noise song that repeats all night - with crossfade on it's a never-ending white noise).

      So what I did was simply have each event start the appropriate song, and after starting it immediately add the white noise to the end of the queue. Then I created a separate event which triggers on Sonos Condition, for when the white noise song starts. Anytime the White noise song starts, it immediately clears the queue, sets volume and repeat, and re-starts playing it (this restart doesn't get noticed since the first second or so of the song is silent).

      It works pretty well. *once*, it didn't trigger, which I don't know why, which was annoying because the song ended up being both too loud, plus no repeat. But that's only happened to me once.

      Ideally I'd like to still find away to do it in a single event....

      One low-tech way I considered was simply checking exactly how long each song is and setting it's appropriate event with a wait xxx # of seconds, and then continuing with the white noise, all in one event. Not ideal, but could work.

      Paul

      Comment


        #4
        Originally posted by paul View Post
        Hi there, I made it work, but indeed I had to use two events to accomplish it, which I was trying to avoid, but oh well.

        What I have is a bunch of events that play a different guided meditation for my kids when going to sleep, which they really like. Once that's finished, I have it switch to white noise, which it then repeats forever (10 min white noise song that repeats all night - with crossfade on it's a never-ending white noise).

        So what I did was simply have each event start the appropriate song, and after starting it immediately add the white noise to the end of the queue. Then I created a separate event which triggers on Sonos Condition, for when the white noise song starts. Anytime the White noise song starts, it immediately clears the queue, sets volume and repeat, and re-starts playing it (this restart doesn't get noticed since the first second or so of the song is silent).

        It works pretty well. *once*, it didn't trigger, which I don't know why, which was annoying because the song ended up being both too loud, plus no repeat. But that's only happened to me once.

        Ideally I'd like to still find away to do it in a single event....

        One low-tech way I considered was simply checking exactly how long each song is and setting it's appropriate event with a wait xxx # of seconds, and then continuing with the white noise, all in one event. Not ideal, but could work.

        Paul
        How about you make a playlist, save it as a favorite and just play that? The playlist would have a guided meditation track and then x times the same white noise track, enough to cover a full night?

        Dirk

        Comment


          #5
          Originally posted by dcorsus View Post
          How about you make a playlist, save it as a favorite and just play that? The playlist would have a guided meditation track and then x times the same white noise track, enough to cover a full night?

          Dirk
          That's actually not a bad idea. I might give that a try. Thanks!

          Comment


            #6
            Oh, wait. Except that I still need it to drop the volume after the first piece finishes, as the white noise needs to be way quieter. Hmmm..... got my brain churning now though.

            Comment


              #7
              Originally posted by paul View Post
              Oh, wait. Except that I still need it to drop the volume after the first piece finishes, as the white noise needs to be way quieter. Hmmm..... got my brain churning now though.
              I'm sure you can "re-code" the sound files for a lower volume.
              See this url for example: https://www.howtogeek.com/howto/2070...our-mp3-files/

              Dirk

              Comment

              Working...
              X