Audio Source forwards Android microphone audio input to the PulseAudio daemon through ADB, so you can use your Android device as a USB microphone.
- Device with at least Android 4.0 (API level 14), but fully tested only on Android 10 (API level 29) so your mileage may vary.
- GNU/Linux machine with:
- Android SDK Platform Tools (requires
adbinPATH). - PulseAudio or PipeWire with PulseAudio support (requires
pactlinPATH). - Python 3 (requires
python3inPATH).
- Android SDK Platform Tools (requires
On your Android device:
- Go to Settings > About phone then tap Build number 7 times to enable the Developer options menu.
- In Settings > System > Developer options enable USB debugging (Android Debug Bridge).
- Install the Audio Source Android app:
- (Recommended) Get it on F-Droid.
- Or download the APK from the latest release.
- Or build it from source (see Build and install).
On your Linux PC:
- Download the
audiosourceclient script from the latest release (look for a file namedaudiosourcein the assets section). - Open a terminal in the downloads directory (or
cdinto it). - Then make the script executable with
chmod a+x ./audiosource.
- Connect your Android device to your PC via a USB cable. (Note that wireless debugging should also work, at the cost of increased latency and jitter.)
- On your phone, allow USB debugging, if requested.
- In the terminal, run
./audiosource run. This starts Audio Source and immediately attempts to forward the microphone audio. - On your phone, grant microphone/recording permissions, if requested.
- If the volume is too low, adjust it with
./audiosource volume 200%(replace200%with the desired level). You will likely need a volume level higher than 100%.
If you encounter the adb not found error, it means that the adb command is
either not installed or not in your system's PATH. On most distributions you
can install it via the package manager:
# Arch Linux
$ pacman -S android-tools
# Debian/Ubuntu
$ apt install android-tools-adbAfter installation, verify that it is working with adb --version, and re-run
audiosource.
Common tips:
- Ensure your phone is connected, USB debugging is enabled, and the PC is authorized (check your phone for a prompt to allow the connection).
- Run
adb devicesto confirm your phone is detected (it should show a serial number and "device"). - If no devices are found, try a different USB cable/port or try to re-enable USB debugging.
If you have multiple devices connected then you will have to specify the serial
number of the device you would like to forward audio to. Device serial numbers
can be found by running adb devices.
Then you can specify the serial number as an argument:
$ ./audiosource -s 1234 runOr by setting the ANDROID_SERIAL environment variable:
$ ANDROID_SERIAL=1324 ./audiosource runYou can utilize job control to forward audio from multiple devices simultaneously as follows:
$ ./audiosource -s shiba run & # press ENTER to regain control of your terminal
$ ./audiosource -s 192.168.1.188:39857 runRun ./gradlew tasks to list the available commands.
$ ./audiosource build
$ ./audiosource install-
Generate a Java KeyStore:
$ keytool -keystore /home/user/android.jks -genkey -alias release \ -keyalg RSA -keysize 2048 -validity 30000
-
Create
keystore.propertiesin the project root directory containing:storeFile=/home/user/android.jks storePassword=STORE_PASS keyAlias=release keyPassword=KEY_PASS
-
Build and install:
$ export AUDIOSOURCE_PROFILE=release $ ./audiosource build $ ./audiosource install
sndcpy for the initial implementation of audio playback forwarding.
This project is licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT).


