#Looping Audio issues

1 messages · Page 1 of 1 (latest)

keen ingot
#

Still trying to get a loop to work. Use case is, I want the device closest to me to play a white noise ogg or mp3. I can achieve this with a 12 hour file, but it's a huge file 400mb+ so if there's a network issue it starts stuttering and fails. I have found a 60 minute file that's 50mb and would like to loop it, so that if there's an issue, it can just fail that play and go to the next in the loop. Challenge is the way I have it set up, it starts playing loops a second later through all my loops except for the last one, then plays the full duration. So in essence it stutters, then plays it only once through.

This is set as a script so I can use it on a push button on my dashboard, but also have the ability to call it through an automation that does other events.

I'm doing something wrong, but me and GPT can't figure out what it is:

alias: Play White Noise Loop Redux
sequence:
  - repeat:
      count: 5
      sequence:
        - target:
            entity_id: media_player.m5stack_atom_echo_fddf94_m5stack_atom_echo_fddf94
          data:
            media_content_id: >-
              media-source://media_source/local/Unraid/media/music/Sleep/white-noise-8117.mp3
            media_content_type: audio/mpeg
          action: media_player.play_media
        - delay:
            hours: 0
            minutes: 0
            seconds: 1
            milliseconds: 0

Any thoughts on this would be greatly appreciate thanks in advance!

rugged birch
#

I feel like Music Assistant might be the solution to something like this.
if nothing else you could make a playlist of the same thing multiple times.
but i am sure you could use repeat option

gaunt sable
#

Didn't you use to have a wait_template in there?

#

The play_media appears to be not blocking, so if you don't want it to immediately restart you need some kind of feedback