These samples demonstrate how to use the AAudio API:
- hello-aaudio: creates an output (playback) stream and plays a sine wave when you tap the screen
- echo: creates input (recording) and output (playback) streams, then "echos" the recorded audio to the playback stream.
- Android Device with recording capability
- Android O DP3 (Developer's Preivew) API (android-26) and above
- NDK-r15 or above
- Android Studio 2.3.0+
- Install Android Studio
- Clone this sample repository
- Import the sample project into Android Studio
- File -> New -> Import Project
- Browse to aaudio/build.gradle
- Click "OK"
- Click Run -> Run, choose the sample you wish to run
If you've found an error in these samples, please file an issue.
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.
- 22nd March 2017: Initial release for Android - O DP1. Directly reading & writing to audio streams
- 17th May 2017: Updated for Android-O-DP2 release, using AAudio callback interface
- 3rd July 2017: Allow different audio devices (e.g. USB headphones) to be selected and handle stream disconnection