jdk/src/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java
author serb
Tue, 13 May 2014 16:06:12 +0400
changeset 24561 81c6f1aff26e
parent 19207 3448b0cb4077
child 25128 2dfdfa369071
permissions -rw-r--r--
8042007: Javadoc cleanup of javax.sound.sampled.spi package Reviewed-by: pchelko, bagiras
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
     2
 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.sound.sampled.spi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import javax.sound.sampled.AudioFormat;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.sound.sampled.AudioInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    31
import static javax.sound.sampled.AudioFormat.Encoding;
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    32
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
/**
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    34
 * A format conversion provider provides format conversion services from one or
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    35
 * more input formats to one or more output formats. Converters include codecs,
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    36
 * which encode and/or decode audio data, as well as transcoders, etc. Format
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    37
 * converters provide methods for determining what conversions are supported and
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    38
 * for obtaining an audio stream from which converted data can be read.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * <p>
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    40
 * The source format represents the format of the incoming audio data, which
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    41
 * will be converted.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * <p>
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    43
 * The target format represents the format of the processed, converted audio
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    44
 * data. This is the format of the data that can be read from the stream
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    45
 * returned by one of the {@code getAudioInputStream} methods.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * @author Kara Kytle
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
public abstract class FormatConversionProvider {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    52
    /**
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    53
     * Obtains the set of source format encodings from which format conversion
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    54
     * services are provided by this provider.
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    55
     *
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    56
     * @return array of source format encodings. If for some reason provider
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    57
     *         does not provide any conversion services, an array of length 0 is
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    58
     *         returned.
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    59
     */
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    60
    public abstract Encoding[] getSourceEncodings();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    /**
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    63
     * Obtains the set of target format encodings to which format conversion
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    64
     * services are provided by this provider.
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    65
     *
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    66
     * @return array of target format encodings. If for some reason provider
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    67
     *         does not provide any conversion services, an array of length 0 is
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    68
     *         returned.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     */
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    70
    public abstract Encoding[] getTargetEncodings();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * Indicates whether the format converter supports conversion from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * specified source format encoding.
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    75
     *
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    76
     * @param  sourceEncoding the source format encoding for which support is
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    77
     *         queried
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    78
     * @return {@code true} if the encoding is supported, otherwise
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    79
     *         {@code false}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     */
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    81
    public boolean isSourceEncodingSupported(Encoding sourceEncoding) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    83
        Encoding sourceEncodings[] = getSourceEncodings();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        for(int i=0; i<sourceEncodings.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
            if( sourceEncoding.equals( sourceEncodings[i]) ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * Indicates whether the format converter supports conversion to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * specified target format encoding.
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    96
     *
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    97
     * @param  targetEncoding the target format encoding for which support is
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    98
     *         queried
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
    99
     * @return {@code true} if the encoding is supported, otherwise
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   100
     *         {@code false}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     */
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   102
    public boolean isTargetEncodingSupported(Encoding targetEncoding) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   104
        Encoding targetEncodings[] = getTargetEncodings();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        for(int i=0; i<targetEncodings.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
            if( targetEncoding.equals( targetEncodings[i]) ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
                return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    /**
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   115
     * Obtains the set of target format encodings supported by the format
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   116
     * converter given a particular source format. If no target format encodings
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   117
     * are supported for this source format, an array of length 0 is returned.
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   118
     *
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   119
     * @param  sourceFormat format of the incoming data
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * @return array of supported target format encodings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     */
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   122
    public abstract Encoding[] getTargetEncodings(AudioFormat sourceFormat);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    /**
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   125
     * Indicates whether the format converter supports conversion to a
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   126
     * particular encoding from a particular format.
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   127
     *
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   128
     * @param  targetEncoding desired encoding of the outgoing data
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   129
     * @param  sourceFormat format of the incoming data
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   130
     * @return {@code true} if the conversion is supported, otherwise
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   131
     *         {@code false}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     */
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   133
    public boolean isConversionSupported(Encoding targetEncoding,
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   134
                                         AudioFormat sourceFormat) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   136
        Encoding targetEncodings[] = getTargetEncodings(sourceFormat);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        for(int i=0; i<targetEncodings.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
            if( targetEncoding.equals( targetEncodings[i]) ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    /**
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   147
     * Obtains the set of target formats with the encoding specified supported
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   148
     * by the format converter If no target formats with the specified encoding
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   149
     * are supported for this source format, an array of length 0 is returned.
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   150
     *
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   151
     * @param  targetEncoding desired encoding of the stream after processing
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   152
     * @param  sourceFormat format of the incoming data
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * @return array of supported target formats.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     */
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   155
    public abstract AudioFormat[] getTargetFormats(Encoding targetEncoding,
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   156
                                                   AudioFormat sourceFormat);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * Indicates whether the format converter supports conversion to one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * particular format from another.
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   161
     *
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   162
     * @param  targetFormat desired format of outgoing data
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   163
     * @param  sourceFormat format of the incoming data
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   164
     * @return {@code true} if the conversion is supported, otherwise
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   165
     *         {@code false}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     */
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   167
    public boolean isConversionSupported(AudioFormat targetFormat,
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   168
                                         AudioFormat sourceFormat) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        AudioFormat targetFormats[] = getTargetFormats( targetFormat.getEncoding(), sourceFormat );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        for(int i=0; i<targetFormats.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            if( targetFormat.matches( targetFormats[i] ) ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   180
    /**
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   181
     * Obtains an audio input stream with the specified encoding from the given
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   182
     * audio input stream.
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   183
     *
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   184
     * @param  targetEncoding desired encoding of the stream after processing
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   185
     * @param  sourceStream stream from which data to be processed should be
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   186
     *         read
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   187
     * @return stream from which processed data with the specified target
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   188
     *         encoding may be read
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   189
     * @throws IllegalArgumentException if the format combination supplied is
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   190
     *         not supported.
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   191
     */
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   192
    public abstract AudioInputStream getAudioInputStream(
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   193
            Encoding targetEncoding, AudioInputStream sourceStream);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    /**
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   196
     * Obtains an audio input stream with the specified format from the given
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   197
     * audio input stream.
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   198
     *
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   199
     * @param  targetFormat desired data format of the stream after processing
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   200
     * @param  sourceStream stream from which data to be processed should be
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   201
     *         read
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   202
     * @return stream from which processed data with the specified format may be
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   203
     *         read
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * @throws IllegalArgumentException if the format combination supplied is
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   205
     *         not supported.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     */
24561
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   207
    public abstract AudioInputStream getAudioInputStream(
81c6f1aff26e 8042007: Javadoc cleanup of javax.sound.sampled.spi package
serb
parents: 19207
diff changeset
   208
            AudioFormat targetFormat, AudioInputStream sourceStream);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
}