Transform your Android phone into a wireless speaker for your PC using local network or USB tethering.
- Low-latency audio streaming from PC to Android phone
- Support for WiFi and USB tethering connections
- Auto device discovery via mDNS
- Configurable audio quality presets (Low Latency, Balanced, High Quality)
- Real-time latency monitoring
- Native audio implementation for optimal performance
This app uses a hybrid Flutter + Native approach:
- Flutter: UI, networking, and device discovery
- Native Code: Audio capture (Windows) and playback (Android) for minimal latency
- AudioTrack API for low-latency playback
- Method channel integration with Flutter
- WASAPI (Windows Audio Session API) for audio capture
- Method channel integration with Flutter
lib/
├── main.dart # Entry point, platform detection
├── models/
│ └── connection_config.dart # Configuration models
├── native/
│ └── audio_channel.dart # Native method channel interface
├── screens/
│ ├── client_screen.dart # Android client UI
│ └── server_screen.dart # PC server UI
└── services/
├── audio_service.dart # Audio streaming logic
└── network_service.dart # Network communication
android/
└── app/src/main/kotlin/ # Native Android audio implementation (TODO)
windows/
└── runner/ # Native Windows audio implementation (TODO)
- Flutter SDK 3.9.2 or higher
- For Android: Android Studio with SDK 21+
- For Windows: Visual Studio 2022 with C++ desktop development tools
- Clone the repository:
cd D:\projects\phone_audio_speaker- Install dependencies:
flutter pub get- Run on your device:
For Windows (Server/PC):
flutter run -d windowsFor Android (Client/Phone):
flutter run -d android- Launch the app on your Windows PC
- Click "Start Server" - the app will display your local IP address
- Once a phone connects, click "Start Streaming" to begin audio transmission
- Launch the app on your Android phone
- Option A: Tap the refresh icon to discover servers automatically
- Option B: Manually enter the PC's IP address shown on the server
- Tap "Connect" on the discovered device or manual connection
- Once connected, tap "Start Playing" to hear audio from your PC
- Ensure both devices are on the same WiFi network
- The app uses port 8888 by default
- Device discovery uses mDNS (Multicast DNS)
- Enable USB tethering on your Android phone
- Connect phone to PC via USB
- The app will automatically detect the tethered connection
Three preset quality levels:
| Preset | Sample Rate | Buffer Size | Latency | Use Case |
|---|---|---|---|---|
| Low Latency | 48000 Hz | 512 samples | ~30-50ms | Gaming, Video calls |
| Balanced | 48000 Hz | 1024 samples | ~50-100ms | General use |
| High Quality | 48000 Hz | 2048 samples | ~100-150ms | Music listening |
- INTERNET
- ACCESS_NETWORK_STATE
- ACCESS_WIFI_STATE
- RECORD_AUDIO (for future mic support)
- MODIFY_AUDIO_SETTINGS
- Network access
- Audio device access
-
Android Native Audio (Kotlin) - COMPLETED
- ✅ AudioTrack implementation for low-latency playback
- ✅ Audio buffering with configurable buffer sizes
- ✅ Method channel integration with Flutter
- ✅ Latency monitoring and reporting
-
Windows Native Audio (C++) - COMPLETED
- ✅ WASAPI loopback audio capture (captures system audio)
- ✅ Real-time audio streaming with thread priority optimization
- ✅ Method channel and event channel integration
- ✅ Latency reporting via WASAPI API
-
Flutter Framework - COMPLETED
- ✅ Network service with WiFi and USB tethering support
- ✅ mDNS device discovery
- ✅ Audio streaming service coordinating native + network
- ✅ Server UI (Windows) and Client UI (Android)
- ✅ Configuration presets (Low Latency, Balanced, High Quality)
For better compression and lower bandwidth:
- Integrate Opus codec (already specified in models)
- Add encoding on server side
- Add decoding on client side
- This will reduce network bandwidth and improve quality over WiFi
- Volume control from client
- Audio quality indicator
- Multiple client support
- Save/load connection presets
Android:
flutter build apk --releaseWindows:
flutter build windows --releaseflutter test- Verify both devices are on the same network
- Check firewall settings on PC (allow port 8888)
- Try manual IP connection if auto-discovery fails
- Check audio permissions on both devices
- Try different quality presets
- Ensure no other app is using audio devices
- Use USB tethering instead of WiFi
- Select "Low Latency" preset
- Close background apps
This is a personal project, but suggestions and contributions are welcome.
MIT License
- Flutter team for the excellent framework
- Audio codec implementations (flutter_sound)
- mDNS discovery library