timsu / android-aac-enc Goto Github PK
View Code? Open in Web Editor NEWEncode AAC files in Android
Encode AAC files in Android
Hi, do you have any plan for supporting ADIF format ?
Hi,
I'm getting compile errors because of references to
import com.todoroo.aacenc.R;
But no such file exists
Also in package com.todoroo.aacenc;
various errors due to references to R e.g.
setContentView(R.layout.main);
crash on mi2s
Please add encode method with input and output streams parameters for encoding in real time
how can I use aac-enc in android studio?
Hi @timsu and others,
encoding to aac works like a charm, but it crashes at this part, when my track is longer than 11 seconds or something like 1024 Bytes:
try {
new AACToM4A().convert(TestWearActivity.this, aacFile, m4aFileString);
Log.i(TAG, "File Saved!");
} catch (IOException e) {
Log.e(TAG, "error converting", e);
}
Here's the stacktrace
04-14 11:43:11.386 7586-7672/com.myapplication W/linker﹕ libaac-encoder.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
04-14 11:43:11.678 7586-7672/com.myapplication W/System.err﹕ well you got 274432
04-14 11:43:11.720 7586-7604/com.myapplication V/com.myapplication.common.InternetReachability$NetworkCheckTask﹕ Network is available
04-14 11:43:11.720 7586-7604/com.myapplication V/com.myapplication.activity.MainActivity﹕ Internet is available
04-14 11:43:11.786 7586-7672/com.myapplication I/DefaultMp4Builder﹕ Creating Mp4TrackImpl com.googlecode.mp4parser.authoring.tracks.AACTrackImpl@3948bde4
04-14 11:43:11.808 7586-7672/com.myapplication E/art﹕ Invalid capacity given to PushLocalFrame: 755
--------- beginning of crash
04-14 11:43:11.809 7586-7672/com.myapplication A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0xfffffffc in tid 7672 (AsyncTask #5)
04-14 11:43:11.915 181-181/? I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-14 11:43:11.915 181-181/? I/DEBUG﹕ Build fingerprint: 'google/razor/flo:5.0.2/LRX22G/1649326:user/release-keys'
04-14 11:43:11.915 181-181/? I/DEBUG﹕ Revision: '0'
04-14 11:43:11.915 181-181/? I/DEBUG﹕ ABI: 'arm'
04-14 11:43:11.916 181-181/? I/DEBUG﹕ pid: 7586, tid: 7672, name: AsyncTask #5 >>> com.myapplication <<<
04-14 11:43:11.916 181-181/? I/DEBUG﹕ signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xfffffffc
04-14 11:43:11.949 181-181/? I/DEBUG﹕ r0 00000000 r1 00000000 r2 00000000 r3 fffffaa0
04-14 11:43:11.949 181-181/? I/DEBUG﹕ r4 00000000 r5 00000043 r6 a4498080 r7 9928e610
04-14 11:43:11.949 181-181/? I/DEBUG﹕ r8 9928e670 r9 b4ffca64 sl 00000000 fp 137c5000
04-14 11:43:11.949 181-181/? I/DEBUG﹕ ip b6fc79b8 sp 9928e4e8 lr b4ec079f pc b4ec07a8 cpsr 68070030
04-14 11:43:11.950 181-181/? I/DEBUG﹕ backtrace:
04-14 11:43:11.950 181-181/? I/DEBUG﹕ #00 pc 001c77a8 /system/lib/libart.so (art::JNI::PopLocalFrame(_JNIEnv*, _jobject*)+283)
04-14 11:43:11.950 181-181/? I/DEBUG﹕ #01 pc 000b5f2d /system/lib/libart.so (art::CheckJNI::PopLocalFrame(_JNIEnv*, _jobject*)+56)
04-14 11:43:11.950 181-181/? I/DEBUG﹕ #02 pc 0001e0a1 /system/lib/libjavacore.so
04-14 11:43:11.950 181-181/? I/DEBUG﹕ #03 pc 00021985 /system/lib/libjavacore.so
04-14 11:43:11.950 181-181/? I/DEBUG﹕ #04 pc 00021c99 /system/lib/libjavacore.so
04-14 11:43:11.950 181-181/? I/DEBUG﹕ #05 pc 00271d63 /data/dalvik-cache/arm/system@framework@boot.oat
04-14 11:43:12.297 181-181/? W/debuggerd﹕ type=1400 audit(0.0:12): avc: denied { read } for name="kgsl-3d0" dev="tmpfs" ino=7640 scontext=u:r:debuggerd:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file
04-14 11:43:12.297 181-181/? W/debuggerd﹕ type=1400 audit(0.0:13): avc: denied { read } for name="kgsl-3d0" dev="tmpfs" ino=7640 scontext=u:r:debuggerd:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file
04-14 11:43:13.278 181-181/? W/debuggerd﹕ type=1400 audit(0.0:14): avc: denied { read } for name="kgsl-3d0" dev="tmpfs" ino=7640 scontext=u:r:debuggerd:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file
04-14 11:43:13.278 181-181/? W/debuggerd﹕ type=1400 audit(0.0:15): avc: denied { read } for name="kgsl-3d0" dev="tmpfs" ino=7640 scontext=u:r:debuggerd:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file
04-14 11:43:13.308 181-181/? W/debuggerd﹕ type=1400 audit(0.0:16): avc: denied { read } for name="kgsl-3d0" dev="tmpfs" ino=7640 scontext=u:r:debuggerd:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file
04-14 11:43:13.308 181-181/? W/debuggerd﹕ type=1400 audit(0.0:17): avc: denied { read } for name="kgsl-3d0" dev="tmpfs" ino=7640 scontext=u:r:debuggerd:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file
--------- beginning of system
My PCM file has sample rate 44100Hz @ 16bit
The encoder is initialized with the following line of code:
encoder.init(128000, 1, 44100, 16, aacFileString);
It would be really great, if you could help me.
Greetings,
Frank
What is the reason for your project?
You didn't explain how to use, how to compile.
No inforation at all. Project is made for eclipse, gradle is not supported.
HI, has plan to support x86 ?
03-07 15:42:31.151 5562 5562 F DEBUG : ABI: 'arm64'
03-07 15:42:31.151 5562 5562 F DEBUG : pid: 3395, tid: 5239, name: Thread-27 >>> system_server <<<
03-07 15:42:31.151 5562 5562 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
03-07 15:42:31.151 5562 5562 F DEBUG : x0 0000000000000000 x1 0000000000001477 x2 0000000000000006 x3 0000000000000008
03-07 15:42:31.151 5562 5562 F DEBUG : x4 2029613128207463 x5 8000000000000000 x6 0000007fa7ae3000 x7 0000000000000000
03-07 15:42:31.151 5562 5562 F DEBUG : x8 0000000000000083 x9 ffffffffffffffdf x10 0000000000000000 x11 0000000000000001
03-07 15:42:31.151 5562 5562 F DEBUG : x12 ffffffffffffffff x13 0000000000000000 x14 0000000000000000 x15 00018690d2803d98
03-07 15:42:31.151 5562 5562 F DEBUG : x16 0000007fa74d8ec8 x17 0000007fa7482828 x18 0000000000000000 x19 0000007f7d3d24f8
03-07 15:42:31.152 5562 5562 F DEBUG : x20 0000000000000006 x21 0000007f7d3d2450 x22 000000000000006e x23 00000000000003b0
03-07 15:42:31.152 5562 5562 F DEBUG : x24 0000000000000220 x25 0000007f84673020 x26 0000007f832b52ad x27 00000000000003ae
03-07 15:42:31.152 5562 5562 F DEBUG : x28 0000007f7cc6a020 x29 0000007f7d3d1200 x30 0000007fa747fcd0
03-07 15:42:31.152 5562 5562 F DEBUG : sp 0000007f7d3d11e0 pc 0000007fa7482830 pstate 0000000060000000
03-07 15:42:31.159 5562 5562 F DEBUG :
03-07 15:42:31.159 5562 5562 F DEBUG : backtrace:
03-07 15:42:31.160 5562 5562 F DEBUG : #00 pc 000000000006c830 /system/lib64/libc.so (tgkill+8)
03-07 15:42:31.160 5562 5562 F DEBUG : #1 pc 0000000000069ccc /system/lib64/libc.so (pthread_kill+64)
03-07 15:42:31.160 5562 5562 F DEBUG : #2 pc 0000000000023ea0 /system/lib64/libc.so (raise+24)
03-07 15:42:31.160 5562 5562 F DEBUG : #3 pc 000000000001c924 /system/lib64/libc.so (abort+52)
03-07 15:42:31.160 5562 5562 F DEBUG : #4 pc 0000000000012a9c /system/lib64/libaac-encoder.so (TnsDetect+1116)
03-07 15:42:31.160 5562 5562 F DEBUG : #5 pc 000000000000e76c /system/lib64/libaac-encoder.so (psyMain+2444)
03-07 15:42:31.160 5562 5562 F DEBUG : #6 pc 00000000000058dc /system/lib64/libaac-encoder.so (AacEncEncode+196)
03-07 15:42:31.160 5562 5562 F DEBUG : #7 pc 0000000000004e94 /system/lib64/libaac-encoder.so (voAACEncGetOutputData+172)
03-07 15:42:31.160 5562 5562 F DEBUG : #8 pc 0000000000003f34 /system/lib64/libaac-encoder.so (Java_com_android_server_AACEncoder_encode+396)
03-07 15:42:31.161 5562 5562 F DEBUG : #9 pc 0000000000e5673c /data/dalvik-cache/arm64/system@framework@[email protected] (offset 0xe15000)
03-07 15:42:34.038 2943 2943 E : debuggerd: worker process 5562 timed out
03-07 15:42:34.047 2943 2943 E : debuggerd: killing target 3395
03-07 15:42:34.202 3108 3108 E : eof
03-07 15:42:34.202 3108 3108 E : failed to read size
Apparently sample rate is the length(time in milliseonds) of the pcm recording and it is relevant to the .aac conversion. But somehow it has to be 8000!
This is not realistic, can you please explain this limitation so I can fork and fix this?
android-aac-enc android 5.0 problem:
Fatal signal 11 (SIGSEGV), code 1, fault addr 0x82df8000 in tid 12653 (Thread-589)
When the file size is large, I see:
09-04 01:54:46.442: E/AndroidRuntime(2359): java.lang.RuntimeException: An error occured while executing doInBackground()
09-04 01:54:46.442: E/AndroidRuntime(2359): at android.os.AsyncTask$3.done(AsyncTask.java:278)
09-04 01:54:46.442: E/AndroidRuntime(2359): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
09-04 01:54:46.442: E/AndroidRuntime(2359): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
09-04 01:54:46.442: E/AndroidRuntime(2359): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
09-04 01:54:46.442: E/AndroidRuntime(2359): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
09-04 01:54:46.442: E/AndroidRuntime(2359): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
09-04 01:54:46.442: E/AndroidRuntime(2359): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
09-04 01:54:46.442: E/AndroidRuntime(2359): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
09-04 01:54:46.442: E/AndroidRuntime(2359): at java.lang.Thread.run(Thread.java:856)
09-04 01:54:46.442: E/AndroidRuntime(2359): Caused by: java.lang.RuntimeException: too many PopLocalFrame calls
09-04 01:54:46.442: E/AndroidRuntime(2359): at libcore.io.Posix.writev(Native Method)
09-04 01:54:46.442: E/AndroidRuntime(2359): at libcore.io.BlockGuardOs.writev(BlockGuardOs.java:196)
09-04 01:54:46.442: E/AndroidRuntime(2359): at java.nio.IoVec.doTransfer(IoVec.java:81)
09-04 01:54:46.442: E/AndroidRuntime(2359): at java.nio.FileChannelImpl.transferIoVec(FileChannelImpl.java:327)
09-04 01:54:46.442: E/AndroidRuntime(2359): at java.nio.FileChannelImpl.write(FileChannelImpl.java:505)
09-04 01:54:46.442: E/AndroidRuntime(2359): at java.nio.channels.FileChannel.write(FileChannel.java:716)
09-04 01:54:46.442: E/AndroidRuntime(2359): at com.googlecode.mp4parser.authoring.builder.DefaultMp4Builder$InterleaveChunkMdat.getBox(DefaultMp4Builder.java:448)
09-04 01:54:46.442: E/AndroidRuntime(2359): at com.coremedia.iso.IsoFile.getBox(IsoFile.java:177)
09-04 01:54:46.442: E/AndroidRuntime(2359): at com.todoroo.aacenc.AACToM4A.convert(AACToM4A.java:40)
09-04 01:54:46.442: E/AndroidRuntime(2359): at android.os.AsyncTask$2.call(AsyncTask.java:264)
09-04 01:54:46.442: E/AndroidRuntime(2359): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
09-04 01:54:46.442: E/AndroidRuntime(2359): ... 5 more
When using JNI in Android Studio I get this error:
FAILURE: Build failed with an exception.
I am kinda new to using Native in Android but what could be the issue here?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.