< prev index next >

src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java

Print this page




  58  * converting audio data between different formats, and for translating between
  59  * audio files and streams. It also provides a method for obtaining a
  60  * {@link Line} directly from the {@code AudioSystem} without dealing explicitly
  61  * with mixers.
  62  * <p>
  63  * Properties can be used to specify the default mixer for specific line types.
  64  * Both system properties and a properties file are considered. The
  65  * "sound.properties" properties file is read from an implementation-specific
  66  * location (typically it is the {@code conf} directory in the Java installation
  67  * directory). If a property exists both as a system property and in the
  68  * properties file, the system property takes precedence. If none is specified,
  69  * a suitable default is chosen among the available devices. The syntax of the
  70  * properties file is specified in
  71  * {@link Properties#load(InputStream) Properties.load}. The following table
  72  * lists the available property keys and which methods consider them:
  73  *
  74  * <table class="striped">
  75  * <caption>Audio System Property Keys</caption>
  76  * <thead>
  77  *   <tr>
  78  *     <th>Property Key
  79  *     <th>Interface
  80  *     <th>Affected Method(s)
  81  * </thead>
  82  * <tbody>
  83  *   <tr>
  84  *     <td>{@code javax.sound.sampled.Clip}
  85  *     <td>{@link Clip}
  86  *     <td>{@link #getLine}, {@link #getClip}
  87  *   <tr>
  88  *     <td>{@code javax.sound.sampled.Port}
  89  *     <td>{@link Port}
  90  *     <td>{@link #getLine}
  91  *   <tr>
  92  *     <td>{@code javax.sound.sampled.SourceDataLine}
  93  *     <td>{@link SourceDataLine}
  94  *     <td>{@link #getLine}, {@link #getSourceDataLine}
  95  *   <tr>
  96  *     <td>{@code javax.sound.sampled.TargetDataLine}
  97  *     <td>{@link TargetDataLine}
  98  *     <td>{@link #getLine}, {@link #getTargetDataLine}
  99  * </tbody>
 100  * </table>
 101  *
 102  * The property value consists of the provider class name and the mixer name,
 103  * separated by the hash mark (&quot;#&quot;). The provider class name is the
 104  * fully-qualified name of a concrete {@link MixerProvider mixer provider}
 105  * class. The mixer name is matched against the {@code String} returned by the
 106  * {@code getName} method of {@code Mixer.Info}. Either the class name, or the
 107  * mixer name may be omitted. If only the class name is specified, the trailing
 108  * hash mark is optional.
 109  * <p>
 110  * If the provider class is specified, and it can be successfully retrieved from
 111  * the installed providers, the list of {@code Mixer.Info} objects is retrieved
 112  * from the provider. Otherwise, or when these mixers do not provide a
 113  * subsequent match, the list is retrieved from {@link #getMixerInfo} to contain
 114  * all available {@code Mixer.Info} objects.
 115  * <p>
 116  * If a mixer name is specified, the resulting list of {@code Mixer.Info}
 117  * objects is searched: the first one with a matching name, and whose
 118  * {@code Mixer} provides the respective line interface, will be returned. If no
 119  * matching {@code Mixer.Info} object is found, or the mixer name is not
 120  * specified, the first mixer from the resulting list, which provides the
 121  * respective line interface, will be returned.
 122  * <p>
 123  * For example, the property {@code javax.sound.sampled.Clip} with a value




  58  * converting audio data between different formats, and for translating between
  59  * audio files and streams. It also provides a method for obtaining a
  60  * {@link Line} directly from the {@code AudioSystem} without dealing explicitly
  61  * with mixers.
  62  * <p>
  63  * Properties can be used to specify the default mixer for specific line types.
  64  * Both system properties and a properties file are considered. The
  65  * "sound.properties" properties file is read from an implementation-specific
  66  * location (typically it is the {@code conf} directory in the Java installation
  67  * directory). If a property exists both as a system property and in the
  68  * properties file, the system property takes precedence. If none is specified,
  69  * a suitable default is chosen among the available devices. The syntax of the
  70  * properties file is specified in
  71  * {@link Properties#load(InputStream) Properties.load}. The following table
  72  * lists the available property keys and which methods consider them:
  73  *
  74  * <table class="striped">
  75  * <caption>Audio System Property Keys</caption>
  76  * <thead>
  77  *   <tr>
  78  *     <th scope="col">Property Key
  79  *     <th scope="col">Interface
  80  *     <th scope="col">Affected Method(s)
  81  * </thead>
  82  * <tbody>
  83  *   <tr>
  84  *     <th scope="row">{@code javax.sound.sampled.Clip}
  85  *     <td>{@link Clip}
  86  *     <td>{@link #getLine}, {@link #getClip}
  87  *   <tr>
  88  *     <th scope="row">{@code javax.sound.sampled.Port}
  89  *     <td>{@link Port}
  90  *     <td>{@link #getLine}
  91  *   <tr>
  92  *     <th scope="row">{@code javax.sound.sampled.SourceDataLine}
  93  *     <td>{@link SourceDataLine}
  94  *     <td>{@link #getLine}, {@link #getSourceDataLine}
  95  *   <tr>
  96  *     <th scope="row">{@code javax.sound.sampled.TargetDataLine}
  97  *     <td>{@link TargetDataLine}
  98  *     <td>{@link #getLine}, {@link #getTargetDataLine}
  99  * </tbody>
 100  * </table>
 101  *
 102  * The property value consists of the provider class name and the mixer name,
 103  * separated by the hash mark ("#"). The provider class name is the
 104  * fully-qualified name of a concrete {@link MixerProvider mixer provider}
 105  * class. The mixer name is matched against the {@code String} returned by the
 106  * {@code getName} method of {@code Mixer.Info}. Either the class name, or the
 107  * mixer name may be omitted. If only the class name is specified, the trailing
 108  * hash mark is optional.
 109  * <p>
 110  * If the provider class is specified, and it can be successfully retrieved from
 111  * the installed providers, the list of {@code Mixer.Info} objects is retrieved
 112  * from the provider. Otherwise, or when these mixers do not provide a
 113  * subsequent match, the list is retrieved from {@link #getMixerInfo} to contain
 114  * all available {@code Mixer.Info} objects.
 115  * <p>
 116  * If a mixer name is specified, the resulting list of {@code Mixer.Info}
 117  * objects is searched: the first one with a matching name, and whose
 118  * {@code Mixer} provides the respective line interface, will be returned. If no
 119  * matching {@code Mixer.Info} object is found, or the mixer name is not
 120  * specified, the first mixer from the resulting list, which provides the
 121  * respective line interface, will be returned.
 122  * <p>
 123  * For example, the property {@code javax.sound.sampled.Clip} with a value


< prev index next >