Merge "Add some javadoc to AudioRecord, plus updates based on code review comments."
This commit is contained in:
@@ -31,9 +31,9 @@ public class AudioFormat {
|
||||
public static final int ENCODING_INVALID = 0;
|
||||
/** Default audio data format */
|
||||
public static final int ENCODING_DEFAULT = 1;
|
||||
/** Audio data format: PCM 16 bit per sample */
|
||||
/** Audio data format: PCM 16 bit per sample. Guaranteed to be supported by devices. */
|
||||
public static final int ENCODING_PCM_16BIT = 2; // accessed by native code
|
||||
/** Audio data format: PCM 8 bit per sample */
|
||||
/** Audio data format: PCM 8 bit per sample. Not guaranteed to be supported by devices. */
|
||||
public static final int ENCODING_PCM_8BIT = 3; // accessed by native code
|
||||
|
||||
/** Invalid audio channel configuration */
|
||||
|
||||
@@ -194,11 +194,13 @@ public class AudioRecord
|
||||
* Class constructor.
|
||||
* @param audioSource the recording source. See {@link MediaRecorder.AudioSource} for
|
||||
* recording source definitions.
|
||||
* @param sampleRateInHz the sample rate expressed in Hertz. Examples of rates are (but
|
||||
* not limited to) 44100, 22050 and 11025.
|
||||
* @param sampleRateInHz the sample rate expressed in Hertz. 44100Hz is currently the only
|
||||
* rate that is guaranteed to work on all devices, but other rates such as 22050,
|
||||
* 16000, and 11025 may work on some devices.
|
||||
* @param channelConfig describes the configuration of the audio channels.
|
||||
* See {@link AudioFormat#CHANNEL_IN_MONO} and
|
||||
* {@link AudioFormat#CHANNEL_IN_STEREO}
|
||||
* {@link AudioFormat#CHANNEL_IN_STEREO}. {@link AudioFormat#CHANNEL_IN_MONO} is guaranteed
|
||||
* to work on all devices.
|
||||
* @param audioFormat the format in which the audio data is represented.
|
||||
* See {@link AudioFormat#ENCODING_PCM_16BIT} and
|
||||
* {@link AudioFormat#ENCODING_PCM_8BIT}
|
||||
@@ -444,6 +446,8 @@ public class AudioRecord
|
||||
* or {@link #ERROR} if the implementation was unable to query the hardware for its
|
||||
* output properties,
|
||||
* or the minimum buffer size expressed in bytes.
|
||||
* @see #AudioRecord(int, int, int, int, int) for more information on valid
|
||||
* configuration values.
|
||||
*/
|
||||
static public int getMinBufferSize(int sampleRateInHz, int channelConfig, int audioFormat) {
|
||||
int channelCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user