GithubHelp home page GithubHelp logo

barsoosayque / libgdx-oboe Goto Github PK

View Code? Open in Web Editor NEW
54.0 7.0 10.0 46.4 MB

๐ŸŽถ libGDX audio replacement for Android (API 16+) built on top of Oboe.

License: MIT License

CMake 2.32% C++ 78.56% Kotlin 8.97% Shell 7.62% Nix 2.52%

libgdx-oboe's Introduction

Icon

libGDX Oboe

libGDX oboe

Reimplementation of the Audio interface for libGDX framework using Oboe and FFmpeg, which allows music to flow without any delay or another unpleasant distortion.

And if you ever asked yourself "Why is my libGDX app music is so broken ?", then you've come to the right place.

๐Ÿ”ฐ How to Use ใƒป ๐ŸŽบ Explore Examples ใƒป ๐Ÿšœ How to Build

Content of docs directory.

Quick, show me some code !

Here is how do one essentially "use" this library (code in Kotlin):

class AndroidLauncher : AndroidApplication() {
    // Magic happens here:
    override fun createAudio(context: Context, config: AndroidApplicationConfiguration): AndroidAudio =
            OboeAudio(context.assets)

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // Create an app like always
        val config = AndroidApplicationConfiguration()
        initialize(SomeApp(), config)
    }
}

How does this works ?

Using Oboe library from Google, you can create high-performance audio streams which may plug in and tweak some features in runtime to boost speed even further. This streams are native, so there is no GC that will slow things down. For audio decoding, this library also provide native tools: libavformat and friends (FFmpeg) with MP3, OGG and WAV support only. Such audio decoder is blazing fast, so combining that with oboe streams, we get ourselves responsive and fast Audio implementation.

State of features

Here is a table of known goodies and problems for certain features per file format (decoder):

Feature State Description
Sounds โญ Per-sound soundpools. All features should be working. Although max sounds isn't read from android config, the number is infinite at the moment.
Music playing โญ Precise position, starts and pauses exactly when requested.
Music Seek ๐Ÿ‘Œ WAV is precise, no content lost. OGG and MP3 is different: bad initial seek, but dropping frames until PTS is equal to desired seek TS. May lose some content if PTS isn't precise enough.
Audio Device ๐Ÿ‘Œ Repetitive writes to audio device might produce audio artifacts (cracks).
Audio Recorder ๐Ÿ‘Œ Repetitive reads bleed a little bit of cache from the last read to the buffer. Omit a few first frames when using recorded PCM.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.