Comments (4)
put the libaac-encoder in to the armeabi-v7a and armeabi
from android-aac-enc.
final String name = files.get(postion).getParentFile().getAbsolutePath() + "/" + files.get(postion).getName().replace(".wav", ".mp4");
AACEncoder aacEncoder = new AACEncoder();
ByteArrayOutputStream bos = null;
int size = 0;
byte[] buffer = null;
try {
File file = files.get(postion);
FileInputStream fis = new FileInputStream(file);
bos = new ByteArrayOutputStream();
byte[] b = new byte[1000];
int n;
while ((n = fis.read(b)) != -1) {
bos.write(b, 0, n);
}
bos.size();
fis.close();
bos.close();
buffer = bos.toByteArray();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Uri uri = Uri.parse(files.get(postion).getAbsolutePath());
MediaMetadataRetriever mmr = new MediaMetadataRetriever();
mmr.setDataSource(this,uri);
String durationStr = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
int millSecond = Integer.parseInt(durationStr);
int bitRate = Integer.parseInt(mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_BITRATE));
Log.e("xxx", bitRate + "");
aacEncoder.init(bitRate, 1, 44100, 16, name.replace(".mp4", ".aac"));
aacEncoder.encode(buffer);
aacEncoder.uninit();
work normal!
from android-aac-enc.
Having the same....what might be the problem?
from android-aac-enc.
Having the same....
from android-aac-enc.
Related Issues (16)
- RunTime Exception HOT 3
- how can I use aac-enc in android studio? HOT 3
- HI, has plan to support x86 ? HOT 2
- supporting ADIF format
- How to use
- I pulled this in and I'm now getting a crash per 1024 samples:
- More than one file was found with OS independent path 'lib/armeabi-v7a/libaac-encoder.so'
- how to using android studio3+οΌand pause recording
- Modify for streamining conversion HOT 2
- "Pop" at start of file after conversion. HOT 1
- IOException when recording HOT 2
- Missing files ? HOT 2
- crash on mi2s
- samplerate? HOT 2
- AACTrackImpl crashes when Track is longer than 11 seconds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-aac-enc.