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.
You wrote setRecyleWhenDone instead of setRecycleWhenDone in README.md.
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.)