Package javax.sound.sampled

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


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

}
View Full Code Here


        // and AudioFormat does not implement this and finalizes it.
        Iterator iterator = sourceFormatTargetEncodings.entrySet().iterator();
        while (iterator.hasNext()) {
            Map.Entry entry = (Map.Entry) iterator.next();
            AudioFormat format = (AudioFormat) entry.getKey();
            if (format.matches(sourceFormat)) {
                AudioFormat.Encoding[] targetEncodings = (AudioFormat.Encoding[]) entry.getValue();
                if (Globals.DEBUG) System.out.println("   targetEncodings:");
                if (Globals.DEBUG) printAudioEncodings(targetEncodings, System.out);
                return targetEncodings;
            } // if
View Full Code Here

        AudioInputStream cs = null;

        AudioFormat inputFormat = stream.getFormat();

        if( inputFormat.matches(outputFormat) ) {

            cs = stream;
        } else {

            cs = (AudioInputStream) (new PCMtoPCMCodecStream(stream, outputFormat));
View Full Code Here

    private AudioInputStream getConvertedStream(AudioFormat outputFormat, AudioInputStream stream) {

        AudioInputStream cs = null;
        AudioFormat inputFormat = stream.getFormat();

        if( inputFormat.matches(outputFormat) ) {

            cs = stream;
        } else {

            cs = (AudioInputStream) (new AlawCodecStream(stream, outputFormat));
View Full Code Here

    private AudioInputStream getConvertedStream(AudioFormat outputFormat, AudioInputStream stream) {
        AudioInputStream cs = null;

        AudioFormat inputFormat = stream.getFormat();

        if( inputFormat.matches(outputFormat) ) {
            cs = stream;
        } else {
            cs = (AudioInputStream) (new UlawCodecStream(stream, outputFormat));
        }
        return cs;
View Full Code Here

    private AudioInputStream getConvertedStream(AudioFormat outputFormat, AudioInputStream stream) {

        AudioInputStream cs = null;
        AudioFormat inputFormat = stream.getFormat();

        if( inputFormat.matches(outputFormat) ) {
            cs = stream;
        } else {
            cs = (AudioInputStream) (new AlawCodecStream(stream, outputFormat));
        }
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.