Class WAVData

  • public final class WAVData
    extends Object
    This class is a holder for WAV (.wav ) file Data returned from the WavLoader, or directly via #loadFromStream(InputStream, int, int, int).
    Athomas Goldberg,
    • Field Detail

      • data

        public final ByteBuffer data
        The audio data
      • format

        public final int format
        the format of the Data. One of:
      • size

        public final int size
        Size (in bytes) of the data
      • freq

        public final int freq
        The frequency of the data
      • loop

        public final boolean loop
        flag indicating whether or not the sound in the data should loop
    • Constructor Detail

      • WAVData

        public WAVData​(ByteBuffer data,
                       int format,
                       int size,
                       int freq,
                       boolean loop)
    • Method Detail

      • loadFromStream

        public static WAVData loadFromStream​(InputStream aIn,
                                             int byteCount,
                                             int numChannels,
                                             int bits,
                                             int sampleRate,
                                             ByteOrder byteOrder,
                                             boolean loop)
                                      throws IOException
        This method loads a (.wav) file into a WAVData object.
        aIn - An InputStream for the .WAV stream
        byteCount - byte count of expected wav data to be read
        numChannels -
        bits -
        sampleRate -
        byteOrder -
        a WAVData object containing the audio data
        UnsupportedAudioFileException - if the format of the audio if not supported.
        IOException - If the file can no be found or some other IO error occurs