AudioCue, an alternative to Clip, for 2D games

Works like a dream. Going to convert all my game audio over to use this library. Nice work. The ability to concurrently fire dozens copies of the same audio clip is so useful!

AudioCue 2.0 is now available through maven.org!

groupId = com.adonax
artifactId = audiocue
version = 2.0.0
github project: philfrei/AudioCue-maven

If you are using the original version, I recommend switching over. The API is very similar. There are a couple minor changes, but they donā€™t affect common tasks. For example, the demo code at github.com/philfrei/audiocue-demo should still work.

(I think this is the only actual API change, a rename of AudioCue.getTrackLength to AudioMixer.getTracksCount for clarityā€“the name now reflects the content of what is returned instead of referring to a specfic detail of the implementation.)

Most of the improvements are behind the scenes: added quite a few unit tests, made a more rigorous pass on the Javadocs, increased the accuracy of the cursor locations to doubles while retaining float calculations for the PCM encoding. Also clarified/refactored some state variables. In the process I found and fixed a bug or API decision here and there.

Please give it a try!

Iā€™m happy to help if there are any problems or questions.

2 Likes

You wrote setRecyleWhenDone instead of setRecycleWhenDone in README.md.

1 Like

Thanks! I made the edit. I just tried push this and additional updates (some are pretty important, imho), but realized I have some chores to do first (e.g., generate new github PAT) and have to head to work now. Hopefully soon. Iā€™ve been hesitating to post github updates because of being nervous about posting version 2.1.0 on Maven, wanting to dot all iā€™s and cross all tā€™s. This is my first time for posting a Maven update and I want to make sure itā€™s coordinated with the github version correctly. Itā€™s going to take some hours of not being distracted which seems to be hard to do with my current set of part time jobs. But it seems to me I can/should at least update the github versionā€“it should be okay if it runs ahead of Maven.

I pushed the more recent work done on AudioCue. The changes will correspond to version 2.1.0 which has not yet been posted to Maven. Git and github still make me nervous! The README.md file had some edits made from the github site and from the local project that I had to figure out how to resolve and merge before I could push the latest changes. I still donā€™t have the spacing on the code examples in the README done exactly right. Tabs should only be 4 spaces, not 8.

Various things updated:

  • discovered a potential race condition and fixed it,
  • volume and panning types have been added (audiocue.AudioCueFunctions a static class),
  • added the capability of obtaining the PCM data (signed normalized floats) that is stored internally as part of the AudioCue (thus, the library could be used to convert .wav files to PCM),
  • implemented autocloseable,
  • numerous documentation updates and fixes.

So,one might consider forking the github project and generating a package using Maven CLI, until I get 2.1.0 posted on the Maven central repository. (Or just copy the six files directly into your program.)