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, have emerged.

The sfxr generator

The sfxr sound generator quickly became widespread among independent game developers everywhere because it simplified the creation of new sounds just by clicking on the RANDOMIZE button. Naturally, all other parameters used to create a sound are tweakable to allow fine-tuning. Also, simple means are provided to get the basic sound effects into games through presets as buttons to the left of the program GUI, such as PICKUP/COIN, LASER/SHOOT, EXPLOSION, POWERUP, HIT/HURT, JUMP, and BLIP/SELECT, as shown in the following screenshot. If you like a generated sound effect, you can export it to a .wav file to be used in your game.

The sfxr generator

The official source code repository of sfxr can be found at https://code.google.com/p/sfxr/.

A web version is also available at http://www.superflashbros.net/as3sfxr/.

The cfxr generator

The cfxr sound generator was originally developed by Joachim Bengtsson in 2008. It is based on sfxr and was ported to Mac OS as a native Cocoa application, and hence the name cfxr (Cocoa sfxr). A history list was added with the possibility to rate each generated sound effect by the user. This also allows you to easily flip through a couple of sounds and jump back to previous ones if needed. The following screenshot shows the interface of the cfxr generator:

The cfxr generator

The official source code repository of cfxr can be found at https://github.com/nevyn/cfxr/.

The bfxr generator

This sound generator was originally developed by Stephen "Increpare" Lavelle. It appears to be the most advanced version of that time. Some additional waveforms as well as a mixer have been added to create more complex sounds. The created sounds can be saved to and loaded from files, which is a useful feature that is available in neither sfxr nor cfxr. Additionally, the lock symbol next to each parameter can be used to avoid any further changes to them while using the Randomize and Mutation buttons, as shown in the following screenshot:

The bfxr generator

The official source code repository of bfxr can be found at https://github.com/increpare/bfxr/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset