samplerate?
pseudozach opened this issue · 2 comments
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?
That doesn't seem right. I found the original blog article - here it is: http://betaful.com/post/82668810035/encoding-aac-audio-in-android
The sample rate should be the # of samples per second.
my PCM is 44.1kHZ, 16bit, mono using these values I cant get the pcm -> aac conversion
the 3rd parameter in init must be a multiple of 8000 or the whole thing crashes, I couldnt find the C source for this. Can you point it out?
In your sample you used 64000, 1, 8000, 16
but no matter which values I try, I either get a very looong sound (with low samplerate) or a sped up version (with high samplerate)
How can I set the proper sample rate that native code wont reject?
// encoder = new AACEncoder();
// encoder.init(44100, 1, 48000,
// 16, recordFileNameAAC());
//// byte[] input = new byte[data.length];
//// for(int i = 0; i < input.length; i++) {
//// input[i] = (byte) Math.round(255 * Math.sin(i * 1.0 / 10));
//// }
// encoder.encode(data);
// encoder.uninit();