I found there is a mismatch of define constant in these 2 files for
the source input: AudioRecord.h and MediaRecorder.java

In native code (AudioRecord.h), the values are...
44     enum input_source {
45         DEFAULT_INPUT   =-1,
46         MIC_INPUT       = 0,
47         VOICE_UPLINK_INPUT = 1,
48         VOICE_DOWNLINK_INPUT = 2,
49         VOICE_CALL_INPUT = 3,
50         NUM_INPUT_SOURCES
51     };
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=include/media/AudioRecord.h;h=13e51eea1eb478517f677df0642b4d2221571192;hb=donut#l38


In Java MediaRecorder AudioSource, the values are...
120     public final class AudioSource {
121       /* Do not change these values without updating their
counterparts
122        * in include/media/mediarecorder.h!
123        */
124         private AudioSource() {}
125         public static final int DEFAULT = 0;
126         /** Microphone audio source */
127         public static final int MIC = 1;
128
129         /** Voice call uplink (Tx) audio source */
130         public static final int VOICE_UPLINK = 2;
131
132         /** Voice call downlink (Rx) audio source */
133         public static final int VOICE_DOWNLINK = 3;
134
135         /** Voice call uplink + downlink audio source */
136         public static final int VOICE_CALL = 4;
137     }
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=media/java/android/media/MediaRecorder.java;h=be4b489eb08683750fc2149184ab073e8528e6d4;hb=donut#l120


I found a similar thread with this issue too:
http://groups.google.com.tw/group/android-developers/browse_thread/thread/01b53ce66b43810c/a578913b17a6bcca?#a578913b17a6bcca

I need to refer to the define AudioRecord::MIC_INPUT at the source
AudioHardwareALSA.cpp to determine which is the input source and set
the audio route accordingly for MIC recording, but this will cause a
wrong route because of this mismatch of constant define at the 2
source files.

Is it a bug by the Google?

Thanks
-- 
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