AudioRecord input too loud

All your problems with Audio, Video and Images.

AudioRecord input too loud

Postby RaananW » Thu May 27, 2010 1:01 pm

Hi all,

been searching for a solution for a long time with no luck...
I am trying to implement a simple Audio Recorder using the AudioRecord class, read the raw data and convert is in real time to a different audio format. The second part i can handle. My problem is, that for some reason, the microphone input when using the AudioRecord class is too strong, meaning, everything comes out in distortion.

Has anyone ever experienced such a problem? anyone has an idea as to where to start looking for a way to solve this?
I have tested my app on Motorola Droid and HTC Legend, both reacted the same, so i assume it's something i am doing wrong and not hardware...:-)

Thanks in advance!
RaananW
Freshman
Freshman
 
Posts: 2
Joined: Thu May 27, 2010 12:51 pm

Top

Re: AudioRecord input too loud

Postby RaananW » Fri May 28, 2010 10:14 am

So, I managed to solve this, after a long time.

I hope this helps someone (since no one managed to help me) -

My problem was using the read(short[],...) and not the read(byte[],...) in AudioRecord. I have used this function since the encoder i wanted to use required short input and not byte input. For some reason, while recording using the short[] input, the results are distorted. I believe it is due to wrong Mono-To-Stereo interpretation of the data. Taking the byte input and converting it to short (and then later saving in in a ShortBuffer) made the difference, and now it works flawlessly.

If anyone wants more information regarding that, contact me.
RaananW
Freshman
Freshman
 
Posts: 2
Joined: Thu May 27, 2010 12:51 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 12 guests