views:

30

answers:

1

Hello all,

I want to create an application in which i want to record user voice.I want to do the same naimation as voiceMemo application does on iphone when we record sound? any sample code would be appreciated.

Thanks.

+2  A: 

The Voice Memo app displays a VU Meter, which you can implement with a digital (low pass) filter to simulate the ballistics. There is sample code out there, but most of it is poor quality or inaccurate. You can have a layer for the scale background, and another for the needle that you rotate about its origin.

gavinb
i want sample code if you have?
Rahul Vyas
I can't send you sample code, but you can easily find some if you search for "VU Meter" and "low pass filter". You will need to process each frame of audio data with a low pass filter tuned to the VU Meter's response time, which will give you an output level. Scale this level in dB to the full deflection of the needle, and convert that to a rotation using trig. Apply this rotation to the needle layer.
gavinb