Using sound generators
Until now, you learned about direct access to the audio device in LibGDX, and you now know how to write audio samples to it. Sure enough, you could now (try to) write your own sound generator class from here and feed one of LibGDX's audio device instances with the resulting audio samples. However, audio programming is beyond the scope of this book, and it is also a very advanced topic even for seasoned programmers.
A viable solution to get hold of some nice sound effects is to use one of the existing sound generators, which are free and open source. One of these sound generators is sfxr, which was originally developed by Tomas "DrPetter" Pettersson in 2007. Over the time, several sfxr variants, such as bfxr, cfxr, and as3sfxr ...
Get Learning LibGDX Game Development - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.