10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 6938426
27 * @bug 7058852
28 * @summary Tests that Alaw encoder works properly in multithreaded environment
29 * @author Alex Menkov
30 */
31
32 import java.io.ByteArrayInputStream;
33 import java.io.ByteArrayOutputStream;
34 import java.io.InputStream;
35 import java.util.Arrays;
36 import javax.sound.sampled.AudioFormat;
37 import javax.sound.sampled.AudioInputStream;
38 import javax.sound.sampled.AudioSystem;
39
40 public class AlawEncoderSync {
41
42 static final int THREAD_COUNT = 20;
43
44 static final AudioFormat pcmFormat = new AudioFormat(8000f, 16, 2, true, false);
45 static final int STREAM_LENGTH = 10; // in seconds
46 static byte[] pcmBuffer;
47 static final AudioFormat alawFormat
48 = new AudioFormat(AudioFormat.Encoding.ALAW, 8000f, 8, 2, 2, 8000f, false);
49
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 6938426
27 * @bug 7058852
28 * @summary Tests that Alaw encoder works properly in multithreaded environment
29 * @author Alex Menkov
30 * @key randomness
31 */
32
33 import java.io.ByteArrayInputStream;
34 import java.io.ByteArrayOutputStream;
35 import java.io.InputStream;
36 import java.util.Arrays;
37 import javax.sound.sampled.AudioFormat;
38 import javax.sound.sampled.AudioInputStream;
39 import javax.sound.sampled.AudioSystem;
40
41 public class AlawEncoderSync {
42
43 static final int THREAD_COUNT = 20;
44
45 static final AudioFormat pcmFormat = new AudioFormat(8000f, 16, 2, true, false);
46 static final int STREAM_LENGTH = 10; // in seconds
47 static byte[] pcmBuffer;
48 static final AudioFormat alawFormat
49 = new AudioFormat(AudioFormat.Encoding.ALAW, 8000f, 8, 2, 2, 8000f, false);
50
|