Oboe C++ Library

repository·main·Indexed 26 days ago

https://github.com/google/oboe

A C++ library for high-performance audio development on Android that provides a unified API abstracting over OpenSL ES and AAudio. It supports API level 16 and onwards, featuring automatic API selection, latency management, and built-in workarounds for Android audio issues. The documentation includes guides for getting started, API references, and sample applications such as FXLab, OboeTester, DrumThumper, and LiveEffect.

Tokens
23.1K
Snippets
31
Records
134
Agent score
87%

What's inside Oboe

  1. Overview of Android FXLab

    main
    Android FXLab is a sample application that demonstrates real-time audio effects processing with low latency using the Oboe API. The application uses a native C++ implementation for audio effects processing and Kotlin for the user interface. It supports a linear pipeline of real-time effects that can be re-ordered, enabled/disabled, and parameterized in real-time.
  2. Overview of Oboe

    main
    Oboe is a C++ library designed for building high-performance audio applications on Android. It provides a simplified, unified API that works across multiple Android API levels, starting from API level 16 (Jelly Bean).
  3. Overview of the PowerPlay Sample application

    main
    PowerPlay is an energy-efficient audio player sample application designed to demonstrate Oboe's Performance Modes. It showcases how to implement low-latency, power-saving, and hardware PCM offload playback modes using a C++ engine (PowerPlayMultiPlayer) and a Jetpack Compose UI.
  4. Overview of Oboe sample applications

    main

    The Oboe repository includes several sample applications demonstrating different audio capabilities:

    • MinimalOboe (Kotlin/Compose): Creates an Oboe stream to play white noise; handles stream restarts on disconnection.
    • hello-oboe (Java): Creates an output stream that plays a sine wave on screen tap.
    • RhythmGame (Java): A rhythm game involving pattern copying (includes an associated codelab).
    • MegaDrone (Java): A 100-oscillator synthesizer demonstrating low latency and CPU performance.
    • DrumThumper (Kotlin): A drum pad that plays sounds from loaded WAV files.
    • LiveEffect (Java): Demonstrates duplex capability by looping audio from an input stream to an output stream.
    • SoundBoard (Kotlin): A 25 to 40 note dynamic synthesizer demonstrating signal combining; restarts stream on display rotation.
    • OboeDJ (Kotlin/Compose): A high-performance DJ app with two independent playback decks and real-time scratching.
    • PowerPlay (Kotlin/Compose): Demonstrates power-efficient features like PCM Offload and automation via ADB.
  5. Overview of the OboeDJ Sample Application

    main
    OboeDJ is a high-performance, low-latency DJ sample application built using the Oboe library. It demonstrates advanced audio manipulation capabilities including dual-deck playback, real-time scratching, and BPM synchronization. The application uses a C++ DJEngine for audio processing and a Jetpack Compose UI for control.
  6. Overview of the DrumThumper sample app

    main

    DrumThumper is an Oboe playback sample application designed as a "Drum Pad" app. It demonstrates best practices for low-latency audio playback on Android using the Oboe API.

    Key capabilities demonstrated include:

    • Playing multiple audio sources mixed into a single Oboe stream.
    • Managing the lifecycle of an Oboe audio stream in relation to the Android application lifecycle.
    • Handling playback errors and output device connection/disconnection.
    • Using the Oboe resampler to resample source audio to the device playback rate to avoid runtime overhead.
    • Controlling relative levels (gain) and stereo placement of audio sources.
    • Supporting both mono and stereo sources.
    • Loading 16-bit PCM WAV data from Android assets.
  7. Overview of iolib for audio playback

    main
    iolib is a C++ static library designed for Android native code. It provides classes for streaming audio playback and mixing from multiple sources, demonstrating best practices for using Oboe. While currently focused on playback, the library is designed to eventually support audio capture as well.
  8. Key features of Oboe

    main

    Oboe offers several advantages for Android audio development:

    • Wide Compatibility: Supports API level 16 and onwards, covering approximately 99% of Android devices.
    • Automatic API Selection: Automatically chooses between OpenSL ES (for API 16+) and AAudio (for API 27+) to ensure the best possible performance on the specific device.
    • Latency Management: Includes automatic latency tuning.
    • Modern C++: Built with modern C++ for clean and elegant code.
    • Stability: Includes built-in workarounds for known Android audio issues.
  9. Access Oboe documentation and guides

    main

    Oboe provides several resources for developers to get started and master the library: