android-aac-enc icon indicating copy to clipboard operation
android-aac-enc copied to clipboard

samplerate?

Open pseudozach opened this issue 10 years ago • 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?

pseudozach avatar Jan 30 '15 01:01 pseudozach

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.

timsu avatar Jan 30 '15 03:01 timsu

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();

pseudozach avatar Jan 30 '15 13:01 pseudozach