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.