Package javax.sound.sampled

Examples of javax.sound.sampled.AudioFormat.matches()


     */
    public static AudioInputStream getConvertedAudioStream(AudioInputStream audio_input_stream) {
        audio_input_stream = convertUnsupportedFormat(audio_input_stream);
        AudioFormat original_audio_format = audio_input_stream.getFormat();
        AudioFormat new_audio_format = getConvertedAudioFormat(original_audio_format);
        if (!new_audio_format.matches(original_audio_format))
            audio_input_stream = AudioSystem.getAudioInputStream(new_audio_format, audio_input_stream);
        return audio_input_stream;
    }


View Full Code Here


        assertTrue(format.matches(format1));

        format1 = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 1f, 2, 3, 4,
                5f, true);
        assertFalse(format.matches(format1));
        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 2f, 2, 3, 4, 5f,
                true);
        assertFalse(format.matches(format1));
        assertFalse(format1.matches(format));
View Full Code Here

        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 2f, 2, 3, 4, 5f,
                true);
        assertFalse(format.matches(format1));
        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 3, 3, 4, 5f,
                true);
        assertFalse(format.matches(format1));
        assertFalse(format1.matches(format));
View Full Code Here

        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 3, 3, 4, 5f,
                true);
        assertFalse(format.matches(format1));
        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 2, 4, 4, 5f,
                true);
        assertFalse(format.matches(format1));
        assertFalse(format1.matches(format));
View Full Code Here

        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 2, 4, 4, 5f,
                true);
        assertFalse(format.matches(format1));
        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 2, 3, 5, 5f,
                true);
        assertFalse(format.matches(format1));
        assertFalse(format1.matches(format));
View Full Code Here

        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 2, 3, 5, 5f,
                true);
        assertFalse(format.matches(format1));
        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 2, 3, 4, 6f,
                true);
        assertFalse(format.matches(format1));
        assertFalse(format1.matches(format));
View Full Code Here

        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 2, 3, 4, 6f,
                true);
        assertFalse(format.matches(format1));
        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 2, 3, 4, 5f,
                false);
        assertTrue(format.matches(format1));
        assertTrue(format1.matches(format));
View Full Code Here

        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 2, 3, 4, 5f,
                false);
        assertTrue(format.matches(format1));
        assertTrue(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW,
                AudioSystem.NOT_SPECIFIED, 2, 3, 4, 5f, true);
        assertTrue(format.matches(format1));
        assertFalse(format1.matches(format));
View Full Code Here

        assertTrue(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW,
                AudioSystem.NOT_SPECIFIED, 2, 3, 4, 5f, true);
        assertTrue(format.matches(format1));
        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 2, 3, 4,
                AudioSystem.NOT_SPECIFIED, true);
        assertTrue(format.matches(format1));
        assertFalse(format1.matches(format));
View Full Code Here

        assertFalse(format1.matches(format));

        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 2, 3, 4,
                AudioSystem.NOT_SPECIFIED, true);
        assertTrue(format.matches(format1));
        assertFalse(format1.matches(format));

        format = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 10, 3, 4, 5f,
                true);
        format1 = new AudioFormat(AudioFormat.Encoding.ALAW, 1f, 10, 3, 4, 5f,
                false);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.