# Audio Player Options

**URL:** <https://discourse.nodered.org/t/audio-player-options/16669>\
**Category:** General\
**Created:** [14 October 2019 01:00 UTC](https://discourse.nodered.org/t/audio-player-options/16669 "2019-10-14T01:00:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![manfacro](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@manfacro](https://discourse.nodered.org/u/manfacro)\
**Post date:** [14 October 2019 01:00 UTC](https://discourse.nodered.org/t/audio-player-options/16669/1 "2019-10-14T01:00:08Z")

</div>

Hi all, with the play sound node, I'm trying to figure out the best way to loop some audio...lets say the application is for a background music player.

I see the options to pause/resume, but no option to loop. I'm trying to figure out what does " **options** : Options - If empty, then the one in dialog is used" mean? Is there like a '-L' flag or something I can pass to get the file to loop? Is there a way to see what player it is using behind the screen? (mplayer/VLC) and then would that allow me to pass command line arguments in the msg.options?

Thanks for any pointers,

--Dan

---

<div class="post-metadata">

**Author:** ![miker256](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miker256/32/13042_2.png) [@miker256](https://discourse.nodered.org/u/miker256)\
**Post date:** [14 October 2019 01:06 UTC](https://discourse.nodered.org/t/audio-player-options/16669/2 "2019-10-14T01:06:05Z")

</div>

> **[node-red-contrib-music](https://flows.nodered.org/node/node-red-contrib-music)**
>
> Synthesise music with node-red. The beat node creates regular beats at a rate you can control, and which can be sunchronised with other machines. The divider node adds information to beat events, dividing beats into bars, bars into phrases, phrases...

---

<div class="post-metadata">

**Author:** ![manfacro](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@manfacro](https://discourse.nodered.org/u/manfacro)\
**Post date:** [14 October 2019 09:24 UTC](https://discourse.nodered.org/t/audio-player-options/16669/3 "2019-10-14T09:24:01Z")

</div>

Thanks for the reply miker256, however I am looking to loop a audio file, not create a loop from a drum machine.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 October 2019 13:29 UTC](https://discourse.nodered.org/t/audio-player-options/16669/4 "2019-10-14T13:29:51Z")

</div>

This example creates a queue where the next thing starts when the one before finishes  
[https://flows.nodered.org/flow/cea8afa28b7a93ebdc0f](https://flows.nodered.org/flow/cea8afa28b7a93ebdc0f)  
It should be possible to adapt this to just repeat instead of taking the next item.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [14 October 2019 14:37 UTC](https://discourse.nodered.org/t/audio-player-options/16669/5 "2019-10-14T14:37:38Z")

</div>

have you looked at node-red-contrib-play-sound? I use it for a music box I built. It emits a msg when the sound is finished playing. You could check for that and feed back to the input to cause the loop.

---

<div class="post-metadata">

**Author:** ![manfacro](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@manfacro](https://discourse.nodered.org/u/manfacro)\
**Post date:** [14 October 2019 15:23 UTC](https://discourse.nodered.org/t/audio-player-options/16669/6 "2019-10-14T15:23:46Z")

</div>

I like that solution! Thanks Zenofmud. I saw the bit about the on completion message, just wasn’t thinking about using it to my advantage.
