< prev index next >

src/java.desktop/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java

Print this page


   1 /*
   2  * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  33 import static javax.sound.sampled.AudioFormat.Encoding;
  34 
  35 /**
  36  * A format conversion provider provides format conversion services from one or
  37  * more input formats to one or more output formats. Converters include codecs,
  38  * which encode and/or decode audio data, as well as transcoders, etc. Format
  39  * converters provide methods for determining what conversions are supported and
  40  * for obtaining an audio stream from which converted data can be read.
  41  * <p>
  42  * The source format represents the format of the incoming audio data, which
  43  * will be converted.
  44  * <p>
  45  * The target format represents the format of the processed, converted audio
  46  * data. This is the format of the data that can be read from the stream
  47  * returned by one of the {@code getAudioInputStream} methods.
  48  *
  49  * @author Kara Kytle
  50  * @since 1.3
  51  */
  52 public abstract class FormatConversionProvider {





  53 
  54     /**
  55      * Obtains the set of source format encodings from which format conversion
  56      * services are provided by this provider.
  57      *
  58      * @return array of source format encodings. If for some reason provider
  59      *         does not provide any conversion services, an array of length 0 is
  60      *         returned.
  61      */
  62     public abstract Encoding[] getSourceEncodings();
  63 
  64     /**
  65      * Obtains the set of target format encodings to which format conversion
  66      * services are provided by this provider.
  67      *
  68      * @return array of target format encodings. If for some reason provider
  69      *         does not provide any conversion services, an array of length 0 is
  70      *         returned.
  71      */
  72     public abstract Encoding[] getTargetEncodings();


   1 /*
   2  * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  33 import static javax.sound.sampled.AudioFormat.Encoding;
  34 
  35 /**
  36  * A format conversion provider provides format conversion services from one or
  37  * more input formats to one or more output formats. Converters include codecs,
  38  * which encode and/or decode audio data, as well as transcoders, etc. Format
  39  * converters provide methods for determining what conversions are supported and
  40  * for obtaining an audio stream from which converted data can be read.
  41  * <p>
  42  * The source format represents the format of the incoming audio data, which
  43  * will be converted.
  44  * <p>
  45  * The target format represents the format of the processed, converted audio
  46  * data. This is the format of the data that can be read from the stream
  47  * returned by one of the {@code getAudioInputStream} methods.
  48  *
  49  * @author Kara Kytle
  50  * @since 1.3
  51  */
  52 public abstract class FormatConversionProvider {
  53 
  54     /**
  55      * Constructs a {@code FormatConversionProvider}.
  56      */
  57     protected FormatConversionProvider() {}
  58 
  59     /**
  60      * Obtains the set of source format encodings from which format conversion
  61      * services are provided by this provider.
  62      *
  63      * @return array of source format encodings. If for some reason provider
  64      *         does not provide any conversion services, an array of length 0 is
  65      *         returned.
  66      */
  67     public abstract Encoding[] getSourceEncodings();
  68 
  69     /**
  70      * Obtains the set of target format encodings to which format conversion
  71      * services are provided by this provider.
  72      *
  73      * @return array of target format encodings. If for some reason provider
  74      *         does not provide any conversion services, an array of length 0 is
  75      *         returned.
  76      */
  77     public abstract Encoding[] getTargetEncodings();


< prev index next >