#oboe #audio #android #streaming #api-bindings #rust

aloe-oboe-session

Aloe Oboe Session in Rust manages low-latency audio sessions on Android platforms via the Oboe library. Features include stream handling, latency detection, and error management. This crate is a translation of the c++ juce module serving the same function.

1 unstable release

Uses new Rust 2024

new 0.1.2 Apr 3, 2025

#3 in #oboe


Used in 2 crates

GPL-3.0 license

735KB
5.5K SLoC

Aloe Oboe Session

Aloe Oboe Session provides an interface to manage audio sessions using the Oboe audio library, specifically enabling Rust developers to handle low-latency audio streams on Android devices. This crate facilitates input and output stream management, supporting latency detection and stream parameter configurations.

Features

  • Low-Latency Audio Processing: Seamlessly start, stop, and manage audio streams while detecting input and output latencies.
  • Flexible Sample Format Handling: Utilize different sample formats, including floating-point and integer samples, depending on device capabilities.
  • Error Handling Mechanisms: Robust handling of stream errors with automatic recovery features.

Installation

Add the following line to your Cargo.toml:

[dependencies]
aloe-oboe-session = "0.1.0"

Usage

This crate provides the OboeSessionImpl and OboeSessionBase to manage audio streams. Here is a simple example to initialize a session:

use aloe_oboe_session::{OboeSessionImpl};

fn main() {
    let mut io_device = OboeAudioIODevice::new(); // Assume this is predefined
    let session = OboeSessionImpl::new(
        &mut io_device,
        input_device_id,
        output_device_id,
        num_input_channels,
        num_output_channels,
        sample_rate,
        buffer_size,
    );
    session.start();
    // Your audio processing logic here
    session.stop();
}

API Overview

  • start / stop: Control audio stream lifecycle.
  • get_output_latency_in_samples / get_input_latency_in_samples: Retrieve current stream latencies.
  • on_audio_ready: Callback processing for audio data.

License

Aloe Oboe Session is licensed under the GPL-3.0 License.

Contribution

Contributions are welcome! Please visit the GitHub repository to report issues or submit pull requests.


This README was generated by an AI model and may not be 100% accurate; however, it should be pretty good.

This crate is a translation of the JUCE module.

JUCE is a c++ software framework for developing high performance audio applications.

Usage falls under the GPLv3 as well as the JUCE commercial license.

See github.com/juce-framework/JUCE and the JUCE license page for details.

This crate is in the process of being translated from c++ to rust. For progress updates, please see the workspacer rust project. designed specifically for rust projects.

Dependencies

~42MB
~650K SLoC