Sunday, February 23, 2014

android in AudioRecord recording, and real-time transcoding to MP3 to save


I was recording at the same time, will pass pcm stream real-time MP3 codec, but after transcoding MP3 sound becomes faster, and there is a noise I just altered the function, the original MP3 codec is a wav documents into MP3 files, now changed to provide real-time data come from the MIC
Wav file for reading the original function is :/ *
* Wave_get:
* ---------
* Reads samples from the file in longs. A long can
* Hold one stereo or two mono samples.
* Returns the address of the start of the next frame or NULL if there are no
* More. The last frame will be padded with zero's.
* /
unsigned long int * wave_get (void) {
int n, p;
static char buff [samp_per_frame * 4] ;/ / size samp_per_frame of 1152, macro
defined in types.hn = config.mpeg.samples_per_frame >> (2 - config.wave.channels) ;/ / >> for the right operator
The number
read element: / / read input file a long n-type data, the return valuep = fread (buff, sizeof (unsigned long), (short) n, config.wave.file);

if (! p)
return 0;
else
{
for (; p buff [p] = 0;
unsigned long * ll = (unsigned long *) buff;
return ll;
}
}
Now I changed:
unsigned long int * wave_get (char * b) {
unsigned long * ll = (unsigned long *) b;
if (! b) {
LOGD ("------------- null -------------");
return 0;
} Else {
return ll;
}
}
The data is coming from jni byte [] array, seek expert advice ah<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Their top one
Reply:
Hello, you solve this problem yet, I would like to ask, thank you, I came out of all the noise, I do not know how else
Reply:
I get out all the noise ask the landlord to solve it

Reply:
I somehow have the source code to see ~ ~ ~ < br />http://blog.csdn.net/cboy017/article/details/8455629
Reply:
Great God, and sometimes there will be some blasting sound recordings, may I ask how to conduct a noise reduction process?

No comments:

Post a Comment