• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Error recording audio using native AudioRecord interface

martinb

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

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones