I have a bunch of code that will, when run, produce procedural sound. Unfortunately, it only lasts a few seconds. Ideally it would run until I tell it to stop. I'm not talking about looping, the algorithm to generate it provides 2^64 samples, at the moment, so it isn't going to run out within the foreseeable future. The constructor for AudioInputStream takes a third input, which I could ideally just remove. I could just provide a huge number, but that seems like the wrong way to go about it.
I thought about using SourceDataLine, but the algorithm ideally would be called on-demand, not running ahead and writing the path. Thoughts?
It seems I've answered my own question.
Upon further research, using the
SourceDataLine
is the way to go, as it'll block when you've given it enough to work with.Apologies for the lack of proper Javadoc.