Without Opus/Ogg
Configure builds without Opus and Ogg libraries to reduce binary size
Overview
The Opus and Ogg libraries are embedded by default in flutter_soloud. However, if you don't need streaming capabilities, you can exclude these libraries to reduce your app's binary size by 600~1500 KB (depending on platform).
VS Code Configuration
Add to .vscode/launch.json
:
{
"name": "Flutter debug", // and/or other build configurations
"type": "dart",
"request": "launch",
"program": "lib/main.dart",
"env": {
"NO_OPUS_OGG_LIBS": "1"
}
}
Android Studio Setup
Add under Run/Debug Configurations:
Environment Variables: NO_OPUS_OGG_LIBS="1"
Screenshot
Command Line Build
# Build without Opus/Ogg
flutter clean
flutter pub get
NO_OPUS_OGG_LIBS="1" flutter run
# Reset to default (with Opus/Ogg)
flutter clean
flutter pub get
NO_OPUS_OGG_LIBS= flutter run # Unsets the environment variable
iOS/MacOS Setup
Add to ios/Podfile
or macos/Podfile
:
ENV['NO_OPUS_OGG_LIBS'] = '1'
IDE environment variables are ignored for iOS and MacOS builds.