Skip to content
This repository has been archived by the owner. It is now read-only.
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.

AAudio Sample

These samples demonstrate how to use the AAudio API:

  1. hello-aaudio: creates an output (playback) stream and plays a sine wave when you tap the screen
  2. echo: creates input (recording) and output (playback) streams, then "echos" the recorded audio to the playback stream.

Official AAudio documentation


Getting Started

  1. Install Android Studio
  2. Clone this sample repository
  3. Import the sample project into Android Studio
    • File -> New -> Import Project
    • Browse to aaudio/build.gradle
    • Click "OK"
  4. Click Run -> Run, choose the sample you wish to run


hello-aaudio-screenshot echo-screenshot


If you've found an error in these samples, please file an issue.

Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub. Please see for more details.


Copyright 2017 Google, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Version History

  1. 22nd March 2017: Initial release for Android - O DP1. Directly reading & writing to audio streams
  2. 17th May 2017: Updated for Android-O-DP2 release, using AAudio callback interface
  3. 3rd July 2017: Allow different audio devices (e.g. USB headphones) to be selected and handle stream disconnection
You can’t perform that action at this time.