state-machine

command
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

AAudio stream state machine example.

Demonstrates the lifecycle of an AAudio stream by walking through key state transitions and printing the stream state after each:

Open -> Start -> Stop -> Close

Note that AAudio state transitions are asynchronous: a call to Start() requests the transition and the stream may briefly be in the "Starting" state before reaching "Started". The state printed here is whatever the stream reports immediately after the request returns.

Additional states like Pause, Flush, and their async counterparts (Pausing, Flushing) are part of the AAudio state machine. In a real application you would use WaitForStateChange to synchronize before calling operations that require a specific state (e.g. Flush requires the stream to be fully Paused).

This program must run on an Android device with AAudio support.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL