I have an app that records 8Khz audio, saves to the SD and plays it
back. It uses the AudioRecord API and it works just fine on my Nexus
One (2.2), Behold II (1.6), Cliq XT (1.5) and the emulator (tested
from 1.5 to 2.2).
However, on the market error report, I am seeing the following
IllegalStateException:
Caused by: java.lang.IllegalStateException: startRecording() called on
an uninitialized AudioRecord.
at android.media.AudioRecord.startRecording(AudioRecord.java:495)
It occurs when I attempt to call startRecording() on an instantiated
AudioRecord object. If I catch this exception, or use the getState()
method to determine I am the AudioRecord instance is in an Unitialized
state, what can I do at that point? I've tried creating a new
AudioRecord object, but it just fails with the same
IllegalStateException upon calling startRecord().
if (audioRecordInstance.getState() == AudioRecord.STATE_UNITIALIZED) {
// what can I do here??
audoRecordInstance.stop(); // this throws an illegalStateException
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en