I am running Android Emulator on OS X and trying to use AudioRecord to take a sample of audio and determine the frequency using an FFT jar (for a tuning app).
I am having difficulty with using the phone to debug (http://stackoverflow.com/questions/4425127/android-galaxy-s-phone-adb-debug-bridge-trouble-on-mac-osx) so I want to use the emulator.
When I take a sample of audio from the emulator it appears to contain random values. I would assume that it's recording something, but I'm not sure if it's coming from my computer's microphone. Can anybody confirm what these values might be coming from and if it's possible to use the emulator to record.
I am initializing the AudioRecord object like this:
int frequency = 8000;
int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO;
int audioEncoding = AudioFormat.ENCODING_PCM_16BIT;
try {
// Create a new AudioRecord object to record the audio.
int bufferSize = AudioRecord.getMinBufferSize(frequency,channelConfiguration,audioEncoding);
AudioRecord audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC,
frequency, channelConfiguration,
audioEncoding, bufferSize);
...