summaryrefslogtreecommitdiffstats
path: root/media/java
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2014-09-08 18:28:43 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2014-09-09 17:52:22 -0700
commitaea175e499b40cdb8d3b03ae8bdc9ff66ce786ab (patch)
tree17f054ac74f5180827303f7929c13936b0a20458 /media/java
parent68c936f77d836285c255e98b73bdadb78025ade9 (diff)
downloadframeworks_base-aea175e499b40cdb8d3b03ae8bdc9ff66ce786ab.zip
frameworks_base-aea175e499b40cdb8d3b03ae8bdc9ff66ce786ab.tar.gz
frameworks_base-aea175e499b40cdb8d3b03ae8bdc9ff66ce786ab.tar.bz2
More android.media.AudioFormat.Builder javadoc
Bug 17059703 Change-Id: I1cca2effecbf1998dfa48774d87d94c00285c16c
Diffstat (limited to 'media/java')
-rw-r--r--media/java/android/media/AudioFormat.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/media/java/android/media/AudioFormat.java b/media/java/android/media/AudioFormat.java
index d93d81b..58ed4f8 100644
--- a/media/java/android/media/AudioFormat.java
+++ b/media/java/android/media/AudioFormat.java
@@ -320,15 +320,26 @@ public class AudioFormat {
/**
* Builder class for {@link AudioFormat} objects.
+ * Use this class to configure and create an AudioFormat instance. By setting format
+ * characteristics such as audio encoding, channel mask or sample rate, you indicate which
+ * of those are to vary from the default behavior on this device wherever this audio format
+ * is used.
+ * <p>{@link AudioFormat} is for instance used in
+ * {@link AudioTrack#AudioTrack(AudioAttributes, AudioFormat, int, int, int)}. In this
+ * constructor, every format characteristic set on the <code>Builder</code> (e.g. with
+ * {@link #setSampleRate(int)}) will alter the default values used by an
+ * <code>AudioTrack</code>. In this case for audio playback with <code>AudioTrack</code>, the
+ * sample rate set in the <code>Builder</code> would override the platform output sample rate
+ * which would otherwise be selected by default.
*/
public static class Builder {
- private int mEncoding = ENCODING_PCM_16BIT;
+ private int mEncoding = ENCODING_INVALID;
private int mSampleRate = 0;
private int mChannelMask = CHANNEL_INVALID;
private int mPropertySetMask = AUDIO_FORMAT_HAS_PROPERTY_NONE;
/**
- * Constructs a new Builder with the defaults format values.
+ * Constructs a new Builder with none of the format characteristics set.
*/
public Builder() {
}