0N/A/*
6321N/A * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage com.sun.media.sound;
0N/A
0N/Aimport javax.sound.sampled.AudioFormat;
0N/Aimport javax.sound.sampled.AudioInputStream;
0N/A
0N/Aimport javax.sound.sampled.spi.FormatConversionProvider;
0N/A
0N/A
0N/A/**
0N/A * A codec can encode and/or decode audio data. It provides an
0N/A * AudioInputStream from which processed data may be read.
0N/A * <p>
0N/A * Its input format represents the format of the incoming
0N/A * audio data, or the format of the data in the underlying stream.
0N/A * <p>
0N/A * Its output format represents the format of the processed, outgoing
0N/A * audio data. This is the format of the data which may be read from
0N/A * the filtered stream.
0N/A *
0N/A * @author Kara Kytle
0N/A */
0N/Aabstract class SunCodec extends FormatConversionProvider {
0N/A
6321N/A private final AudioFormat.Encoding[] inputEncodings;
6321N/A private final AudioFormat.Encoding[] outputEncodings;
0N/A
0N/A /**
0N/A * Constructs a new codec object.
0N/A */
6321N/A SunCodec(final AudioFormat.Encoding[] inputEncodings,
6321N/A final AudioFormat.Encoding[] outputEncodings) {
0N/A this.inputEncodings = inputEncodings;
0N/A this.outputEncodings = outputEncodings;
0N/A }
0N/A
0N/A
0N/A /**
0N/A */
6321N/A public final AudioFormat.Encoding[] getSourceEncodings() {
0N/A AudioFormat.Encoding[] encodings = new AudioFormat.Encoding[inputEncodings.length];
0N/A System.arraycopy(inputEncodings, 0, encodings, 0, inputEncodings.length);
0N/A return encodings;
0N/A }
0N/A /**
0N/A */
6321N/A public final AudioFormat.Encoding[] getTargetEncodings() {
0N/A AudioFormat.Encoding[] encodings = new AudioFormat.Encoding[outputEncodings.length];
0N/A System.arraycopy(outputEncodings, 0, encodings, 0, outputEncodings.length);
0N/A return encodings;
0N/A }
0N/A
0N/A /**
0N/A */
0N/A public abstract AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat);
0N/A
0N/A
0N/A /**
0N/A */
0N/A public abstract AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat);
0N/A
0N/A
0N/A /**
0N/A */
0N/A public abstract AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream);
0N/A /**
0N/A */
0N/A public abstract AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream);
0N/A
0N/A
0N/A}