front end – How do I loop audio playback seamlessly and automatically?

(Many of the Audio* symbols and functionality are still mostly experimental, so I understand that not all the kinks might be worked out yet. Still, I’d like to try to make this work!)

When you create an Audio object as output, you have the option to click to expand the output, then click on the “loop” symbol, and play it back looped. E.g.

AudioGenerator({"Sin", Quantity(110, "Hz"), 0})

the default audio outputthe expanded audio output with an arrow pointing to the looping button

(Apologies for the large images; feel free to shrink them if you know how.)

This loops well. However, the only way I know to get this behavior is by clicking on the output manually.

On the other hand, if you create an AudioStream via e.g. AudioPlay, and set Looping -> True, the audio features an unpleasant skip when it loops back to the beginning.

AudioPlay(AudioGenerator({"Sin", Quantity(110, "Hz"), 0}), Looping -> True)

(I still haven’t updated from 12.3.0 to 12.3.1, so if this happens to have been fixed in the 0.0.1 difference, let me know 🙂 )

I’d like a way to loop audio automatically without clicking and free of skipping (in particular, for dynamic purposes). So, I’d like either

  • a way to interface with Audio output objects without mouse inputs that lets me trigger playback and enable looping automatically, preferably while hiding the output form visually as well

  • a way to eliminate the skip heard in looped AudioStreams

  • a totally separate workaround that lets me play back and loop audio programmatically and seamlessly.

(It would also be great to be able to manipulate the audio as its playing—e.g. to change the frequency—so if pursuing one of these directions over another is more amenable to that end goal, I’d appreciate any insight. But that’s not strictly necessary.)