fix: replace libandroidlame with MediaCodec for 16KB page size support #355
+154
−195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🐛 Problem
Google Play Store is rejecting apps that use this library due to
libandroidlame.so
not supporting 16KB page size:✅ Solution
This PR replaces the problematic
libandroidlame
dependency with Android's native MediaCodec API for audio compression, making the library fully compatible with 16KB page size requirements.🔧 Changes Made
AudioCompressor.kt
LameBuilder
andWaveReader
from libandroidlamecompressAudioWithMediaCodec()
method using MediaCodec APIselectAudioTrack()
andprocessAudio()
helper methodsbuild.gradle
implementation 'com.github.banketree:AndroidLame-kotlin:v0.0.1'
dependency🎯 Benefits
📋 Technical Details
🧪 Testing
📝 Migration Notes
For existing users:
.mp3
to.m4a
(AAC)🚀 Impact
This change will allow apps using react-native-compressor to be successfully published on Google Play Store without 16KB page size compatibility issues, while maintaining the same functionality and improving performance.
BREAKING CHANGE: Audio output format changed from MP3 to AAC (M4A)
Fixes: Google Play Store rejection for 16KB page size compatibility
Pull Request opened by Augment Code with guidance from the PR author