The following works fine on a G1 but gives an error on the Samsung
Galaxy. I was hoping cross-platform support would be better than this.
See error below.

    private final static int RATE = 44100;
    private final static int CHANNEL_MODE =
AudioFormat.CHANNEL_CONFIGURATION_MONO;
    private final static int ENCODING =
AudioFormat.ENCODING_PCM_16BIT;
    private AudioRecord recorder_;


 public boolean open() {

  int bufferSize = 4 * AudioRecord.getMinBufferSize(RATE,
CHANNEL_MODE, ENCODING);
  recorder_ = new AudioRecord(AudioSource.MIC, RATE, CHANNEL_MODE,
ENCODING, bufferSize);

last line gives the following on the Samsung Galaxy phone:
11-14 19:04:07.507: ERROR/AndroidRuntime(7617):
java.lang.IllegalArgumentException: Invalid audio buffer size.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to