Skip to content

A 3DSoundSystem-like library for playing sounds with LWJGL3

License

Notifications You must be signed in to change notification settings

BoydRotgans/Audiokode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Audiokode

Allows to play sounds and musics with OpenAL, with an API similar to Paulscode's 3DSoundSystem. Written in Kotlin (meaning it's also compatible with Java)

Example usage: (kotlin)

        // Initialisation
        val engine = SoundEngine()
        engine.initWithDefaultOpenAL()
        
        // ...
        
        // Playing a background music
        val source = engine.backgroundMusic("TestWav", looping = false)
        source.play()
        source.gain = 0.15f // control the gain
        
        // ...
        // in your update/tick/pollEvents application loop:
        engine.update() // this allows the engine to move the listener, update streaming sources etc.

Example usage: (java)

        // Initialisation
        SoundEngine engine = new SoundEngine();
        engine.initWithDefaultOpenAL();
        
        // ...
        
        // Playing a background music
        Source source = engine.backgroundMusic("TestWav", false);
        source.play();
        source.setGain(0.15f); // control the gain
        
        // ...
        // in your update/tick/pollEvents application loop:
        engine.update(); // this allows the engine to move the listener, update streaming sources etc.

The library also allows for quickplaying musics and sounds, ie. playing a non-looping audio stream/file immediately and disposing its resources when it finishes:

        engine.quickplayBackgroundMusic("TestWav");
        // ...
        // in your update/tick/pollEvents application loop:
        engine.update(); 
        // this allows the engine to dispose the resources at the end of playing

About

A 3DSoundSystem-like library for playing sounds with LWJGL3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%