diff --git a/api/current.txt b/api/current.txt index 32707b9b7cd4a..011b13d5fdf9a 100644 --- a/api/current.txt +++ b/api/current.txt @@ -15031,8 +15031,8 @@ package android.media { ctor public AudioRecord.Builder(); method public android.media.AudioRecord build() throws java.lang.UnsupportedOperationException; method public android.media.AudioRecord.Builder setAudioFormat(android.media.AudioFormat) throws java.lang.IllegalArgumentException; + method public android.media.AudioRecord.Builder setAudioSource(int) throws java.lang.IllegalArgumentException; method public android.media.AudioRecord.Builder setBufferSizeInBytes(int) throws java.lang.IllegalArgumentException; - method public android.media.AudioRecord.Builder setCapturePreset(int) throws java.lang.IllegalArgumentException; } public static abstract interface AudioRecord.OnRecordPositionUpdateListener { diff --git a/api/system-current.txt b/api/system-current.txt index e415071636473..ef62b460d8f64 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -16252,8 +16252,8 @@ package android.media { method public android.media.AudioRecord build() throws java.lang.UnsupportedOperationException; method public android.media.AudioRecord.Builder setAudioAttributes(android.media.AudioAttributes) throws java.lang.IllegalArgumentException; method public android.media.AudioRecord.Builder setAudioFormat(android.media.AudioFormat) throws java.lang.IllegalArgumentException; + method public android.media.AudioRecord.Builder setAudioSource(int) throws java.lang.IllegalArgumentException; method public android.media.AudioRecord.Builder setBufferSizeInBytes(int) throws java.lang.IllegalArgumentException; - method public android.media.AudioRecord.Builder setCapturePreset(int) throws java.lang.IllegalArgumentException; method public android.media.AudioRecord.Builder setSessionId(int) throws java.lang.IllegalArgumentException; } diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java index c720e2adab570..216d9b9e21db5 100644 --- a/media/java/android/media/AudioRecord.java +++ b/media/java/android/media/AudioRecord.java @@ -246,8 +246,8 @@ public class AudioRecord * Though some invalid parameters will result in an {@link IllegalArgumentException} exception, * other errors do not. Thus you should call {@link #getState()} immediately after construction * to confirm that the object is usable. - * @param audioSource the recording source (also referred to as capture preset). - * See {@link MediaRecorder.AudioSource} for the capture preset definitions. + * @param audioSource the recording source. + * See {@link MediaRecorder.AudioSource} for the recording source definitions. * @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. @@ -285,8 +285,8 @@ public class AudioRecord * @hide * Class constructor with {@link AudioAttributes} and {@link AudioFormat}. * @param attributes a non-null {@link AudioAttributes} instance. Use - * {@link AudioAttributes.Builder#setCapturePreset(int)} for configuring the capture - * preset for this instance. + * {@link AudioAttributes.Builder#setAudioSource(int)} for configuring the audio + * source for this instance. * @param format a non-null {@link AudioFormat} instance describing the format of the data * that will be recorded through this AudioRecord. See {@link AudioFormat.Builder} for * configuring the audio format parameters such as encoding, channel mask and sample rate. @@ -394,14 +394,14 @@ public class AudioRecord /** * Builder class for {@link AudioRecord} objects. * Use this class to configure and create an AudioRecord instance. By setting the - * recording preset (a.k.a. recording source) and audio format parameters, you indicate which of - * those vary from the default behavior on the device. + * recording source and audio format parameters, you indicate which of + * those vary from the default behavior on the device. *

Here is an example where Builder is used to specify all {@link AudioFormat} * parameters, to be used by a new AudioRecord instance: * *

      * AudioRecord recorder = new AudioRecord.Builder()
-     *         .setCapturePreset(MediaRecorder.AudioSource.VOICE_COMMUNICATION)
+     *         .setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION)
      *         .setAudioFormat(new AudioFormat.Builder()
      *                 .setEncoding(AudioFormat.ENCODING_PCM_16BIT)
      *                 .setSampleRate(32000)
@@ -411,7 +411,7 @@ public class AudioRecord
      *         .build();
      * 
*

- * If the capture preset is not set with {@link #setCapturePreset(int)}, + * If the audio source is not set with {@link #setAudioSource(int)}, * {@link MediaRecorder.AudioSource#DEFAULT} is used. *
If the audio format is not specified or is incomplete, its sample rate will be the * default output sample rate of the device (see @@ -433,18 +433,18 @@ public class AudioRecord } /** - * @param preset the capture preset (also referred to as the recording source). - * See {@link MediaRecorder.AudioSource} for the supported capture preset definitions. + * @param source the audio source. + * See {@link MediaRecorder.AudioSource} for the supported audio source definitions. * @return the same Builder instance. * @throws IllegalArgumentException */ - public Builder setCapturePreset(int preset) throws IllegalArgumentException { - if ( (preset < MediaRecorder.AudioSource.DEFAULT) || - (preset > MediaRecorder.getAudioSourceMax()) ) { - throw new IllegalArgumentException("Invalid audio source " + preset); + public Builder setAudioSource(int source) throws IllegalArgumentException { + if ( (source < MediaRecorder.AudioSource.DEFAULT) || + (source > MediaRecorder.getAudioSourceMax()) ) { + throw new IllegalArgumentException("Invalid audio source " + source); } mAttributes = new AudioAttributes.Builder() - .setInternalCapturePreset(preset) + .setInternalCapturePreset(source) .build(); return this; } diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java index 206c171cb66a4..f27e63561e84f 100644 --- a/media/java/android/media/MediaRecorder.java +++ b/media/java/android/media/MediaRecorder.java @@ -185,9 +185,9 @@ public class MediaRecorder /** * Defines the audio source. * An audio source defines both a default physical source of audio signal, and a recording - * configuration; it's also known as a capture preset. These constants are for instance used + * configuration. These constants are for instance used * in {@link MediaRecorder#setAudioSource(int)} or - * {@link AudioRecord.Builder#setCapturePreset(int)}. + * {@link AudioRecord.Builder#setAudioSource(int)}. */ public final class AudioSource {