Error recording audio using native AudioRecord interface


Last Updated: 2012-12-21 05:30:02
  1. martinb

    martinb New Member

    Hi!

    Has anyone been able to record audio using the native AudioRecord interface? I'm trying to do this on my Neo Freerunner but all I get in logcat is:

    I/AudioHardwareALSA( 787): Initialized ALSA CAPTURE device AndroidRecord_Microphone
    D/AudioHardwareALSA( 787): Set CAPTURE PCM format to S16_LE (Signed 16 bit Little Endian)
    D/AudioHardwareALSA( 787): Using 1 channel for CAPTURE.
    D/AudioHardwareALSA( 787): Set CAPTURE sample rate to 8000 HZ
    E/AudioFlinger( 787): Error reading audio input
    W/AudioRecord( 947): obtainBuffer timed out (is the CPU pegged?) user=00000000, server=00000000

    The android::AudioRecord::read() function returns the number of bytes I'm trying to read, but the resulting buffer is filled with zeroes.

    Any idea or input would be helpful. Thank you.

    Advertisement
  2. israfelwater

    israfelwater New Member

    I had a similar problem, I ended up having to set the user permission

    in the android manifest xml add

    <uses-permission android:name="android.permission.RECORD_AUDIO"/>

    under the manifest tag

Share This Page