1. Check out our companion app, Forums for Android! Download from Google Play

Error recording audio using native AudioRecord interface

Discussion in 'Application Development' started by martinb, May 25, 2009.

  1. martinb

    martinb New Member
    Thread Starter
    5

    May 25, 2009
    1
    0
    5
    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
    5

    Dec 21, 2012
    3
    0
    5
    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

Loading...