1 /*
2 * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
55 /**
56 * The {@code AudioSystem} class acts as the entry point to the sampled-audio
57 * system resources. This class lets you query and access the mixers that are
58 * installed on the system. {@code AudioSystem} includes a number of methods for
59 * converting audio data between different formats, and for translating between
60 * audio files and streams. It also provides a method for obtaining a
61 * {@link Line} directly from the {@code AudioSystem} without dealing explicitly
62 * with mixers.
63 * <p>
64 * Properties can be used to specify the default mixer for specific line types.
65 * Both system properties and a properties file are considered. The
66 * "sound.properties" properties file is read from an implementation-specific
67 * location (typically it is the {@code conf} directory in the Java installation
68 * directory). If a property exists both as a system property and in the
69 * properties file, the system property takes precedence. If none is specified,
70 * a suitable default is chosen among the available devices. The syntax of the
71 * properties file is specified in
72 * {@link Properties#load(InputStream) Properties.load}. The following table
73 * lists the available property keys and which methods consider them:
74 *
75 * <table border=0>
76 * <caption>Audio System Property Keys</caption>
77 * <tr>
78 * <th>Property Key</th>
79 * <th>Interface</th>
80 * <th>Affected Method(s)</th>
81 * </tr>
82 * <tr>
83 * <td>{@code javax.sound.sampled.Clip}</td>
84 * <td>{@link Clip}</td>
85 * <td>{@link #getLine}, {@link #getClip}</td>
86 * </tr>
87 * <tr>
88 * <td>{@code javax.sound.sampled.Port}</td>
89 * <td>{@link Port}</td>
90 * <td>{@link #getLine}</td>
91 * </tr>
92 * <tr>
93 * <td>{@code javax.sound.sampled.SourceDataLine}</td>
94 * <td>{@link SourceDataLine}</td>
95 * <td>{@link #getLine}, {@link #getSourceDataLine}</td>
96 * </tr>
97 * <tr>
98 * <td>{@code javax.sound.sampled.TargetDataLine}</td>
99 * <td>{@link TargetDataLine}</td>
100 * <td>{@link #getLine}, {@link #getTargetDataLine}</td>
101 * </tr>
102 * </table>
103 *
104 * The property value consists of the provider class name and the mixer name,
105 * separated by the hash mark ("#"). The provider class name is the
106 * fully-qualified name of a concrete {@link MixerProvider mixer provider}
107 * class. The mixer name is matched against the {@code String} returned by the
108 * {@code getName} method of {@code Mixer.Info}. Either the class name, or the
109 * mixer name may be omitted. If only the class name is specified, the trailing
110 * hash mark is optional.
111 * <p>
112 * If the provider class is specified, and it can be successfully retrieved from
113 * the installed providers, the list of {@code Mixer.Info} objects is retrieved
114 * from the provider. Otherwise, or when these mixers do not provide a
115 * subsequent match, the list is retrieved from {@link #getMixerInfo} to contain
116 * all available {@code Mixer.Info} objects.
117 * <p>
118 * If a mixer name is specified, the resulting list of {@code Mixer.Info}
119 * objects is searched: the first one with a matching name, and whose
120 * {@code Mixer} provides the respective line interface, will be returned. If no
121 * matching {@code Mixer.Info} object is found, or the mixer name is not
|
1 /*
2 * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
55 /**
56 * The {@code AudioSystem} class acts as the entry point to the sampled-audio
57 * system resources. This class lets you query and access the mixers that are
58 * installed on the system. {@code AudioSystem} includes a number of methods for
59 * converting audio data between different formats, and for translating between
60 * audio files and streams. It also provides a method for obtaining a
61 * {@link Line} directly from the {@code AudioSystem} without dealing explicitly
62 * with mixers.
63 * <p>
64 * Properties can be used to specify the default mixer for specific line types.
65 * Both system properties and a properties file are considered. The
66 * "sound.properties" properties file is read from an implementation-specific
67 * location (typically it is the {@code conf} directory in the Java installation
68 * directory). If a property exists both as a system property and in the
69 * properties file, the system property takes precedence. If none is specified,
70 * a suitable default is chosen among the available devices. The syntax of the
71 * properties file is specified in
72 * {@link Properties#load(InputStream) Properties.load}. The following table
73 * lists the available property keys and which methods consider them:
74 *
75 * <table class="striped">
76 * <caption>Audio System Property Keys</caption>
77 * <thead>
78 * <tr>
79 * <th>Property Key</th>
80 * <th>Interface</th>
81 * <th>Affected Method(s)</th>
82 * </tr>
83 * </thead>
84 * <tbody>
85 * <tr>
86 * <td>{@code javax.sound.sampled.Clip}</td>
87 * <td>{@link Clip}</td>
88 * <td>{@link #getLine}, {@link #getClip}</td>
89 * </tr>
90 * <tr>
91 * <td>{@code javax.sound.sampled.Port}</td>
92 * <td>{@link Port}</td>
93 * <td>{@link #getLine}</td>
94 * </tr>
95 * <tr>
96 * <td>{@code javax.sound.sampled.SourceDataLine}</td>
97 * <td>{@link SourceDataLine}</td>
98 * <td>{@link #getLine}, {@link #getSourceDataLine}</td>
99 * </tr>
100 * <tr>
101 * <td>{@code javax.sound.sampled.TargetDataLine}</td>
102 * <td>{@link TargetDataLine}</td>
103 * <td>{@link #getLine}, {@link #getTargetDataLine}</td>
104 * </tr>
105 * </tbody>
106 * </table>
107 *
108 * The property value consists of the provider class name and the mixer name,
109 * separated by the hash mark ("#"). The provider class name is the
110 * fully-qualified name of a concrete {@link MixerProvider mixer provider}
111 * class. The mixer name is matched against the {@code String} returned by the
112 * {@code getName} method of {@code Mixer.Info}. Either the class name, or the
113 * mixer name may be omitted. If only the class name is specified, the trailing
114 * hash mark is optional.
115 * <p>
116 * If the provider class is specified, and it can be successfully retrieved from
117 * the installed providers, the list of {@code Mixer.Info} objects is retrieved
118 * from the provider. Otherwise, or when these mixers do not provide a
119 * subsequent match, the list is retrieved from {@link #getMixerInfo} to contain
120 * all available {@code Mixer.Info} objects.
121 * <p>
122 * If a mixer name is specified, the resulting list of {@code Mixer.Info}
123 * objects is searched: the first one with a matching name, and whose
124 * {@code Mixer} provides the respective line interface, will be returned. If no
125 * matching {@code Mixer.Info} object is found, or the mixer name is not
|