Files
rk35xx-android14/external/oboe/samples/iolib
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00
..

iolib

Classes for playing audio data.

Abstract

(Oboe) iolib contains classes implementing streaming audio playback and mixing from multiple sources. It's purpose is to demonstrate best practices and provide reusable code.

Note: the more general name of "iolib" was chosen since it is presumed that this project will eventually implement audio capture capability.

iolib is written in C++ and is intended to be called from Android native code. It is implemented as a static library.

iolib project structure

  • player Contains classes to support streaming playback from (potentially) multiple audio sources.

player classes

DataSource

Declares the basic interface for audio data sources.

SampleSource

Extends the DataSource interface for audio data coming from SampleBuffer objects.

OneShotSampleSource

Extends SampleSource to provide data that plays through it's SampleBuffer and then provides silence, (i.e. a non-looping sample)

SampleBuffer

Loads and holds (in memory) audio sample data and provides read-only access to that data.

SimpleMultiPlayer

Implements an Oboe audio stream into which it mixes audio from some number of SampleSources.

This class demonstrates:

  • Creation and lifetime management of an Oboe audio stream (ManagedStream)
  • Logic for an Oboe AudioStreamCallback interface.
  • Logic for handling streaming restart on error (i.e. playback device changes)