Introduction
libGDX provides methods to playback small sound effects as well as stream larger music pieces directly from disk. It also provides convenient read and write access to the audio hardware. audio module, referenced by:
Audio audio = Gdx.audio;
libGDX will automatically pause and resume all audio playback for you if your application is paused and resumed.
Audio on Android
SoundPool API to play Sounds and the MediaPlayer for Music. These API have some limitations and known issues in certain scenarios:
AsynchronousAndroidAudioby implementingcreateAudio()onAndroidLauncherlike this:
Generally speaking, Audio on Android is problematic and there may be other scenarios or device especific issues. Oboe that can be used on libGDX projects thanks to libGDX Oboe.@Overridepublic AndroidAudio createAudio(Context context, AndroidApplicationConfiguration config) { return new AsynchronousAndroidAudio(context, config);}
