Tuesday, May 29, 2018

Java Is Speechless

I can't believe how annoying it is to simply play a .wav in Java. - At least all the solutions I've encountered so.far. I know I should be using something better for game development like c++ or even c#. And I AM interested in tackling c++ but I like Java's portability and I actually like the language. This may be just due to familiarity.

At any rate, until I know c++ well enough to translate WorldWeaver over, Java it is. So I need to find a way to play sounds repeatedly, and rapidly, without all sounds dropping after a while. I keep encounter bad format errors after playing sounds for roughly 20 seconds or so.I believe the error is due to the file being in use. What's weird is, at least in The Swarm, If I try to donit in a class or method, the error occurs. But if I do the same code, duplicated everywhere I play the sounds the error does not occur. - but what a nightmare of redundant code.

Currently I'm using AudioInputStreams, and Clips. There must be a way to define the AudioInputStream and keep it open, resetting it to the start to replay it. So far I haven't uncovered how, if at all, to do this.

No comments:

Post a Comment

From Shotcut to Kdenlive

So I've been using Shotcut for a while now, for my YouTube videos... and music videos. I love the application. Slicing clips, doing fade...