com.groupdocs.metadata.core

Interfaces

Classes

Enums

Exceptions

com.groupdocs.metadata.core

Class WavPackage

  • All Implemented Interfaces:
    Iterable<MetadataProperty>


    public final class WavPackage
    extends CustomPackage

    Represents a native metadata package in a WAV audio file.

    This code sample shows how to extract technical audio information from a WAV file.

    
     try (Metadata metadata = new Metadata(Constants.InputWav)) {
         WavRootPackage root = metadata.getRootPackageGeneric();
         if (root.getWavPackage() != null) {
             System.out.println(root.getWavPackage().getAudioFormat());
             System.out.println(root.getWavPackage().getBitsPerSample());
             System.out.println(root.getWavPackage().getBlockAlign());
             System.out.println(root.getWavPackage().getByteRate());
             System.out.println(root.getWavPackage().getNumberOfChannels());
             System.out.println(root.getWavPackage().getSampleRate());
         }
     }
     
    • Constructor Detail

      • WavPackage

        public WavPackage()

        Initializes a new instance of the WavPackage class.

    • Method Detail

      • getAudioFormat

        public final int getAudioFormat()

        Gets the audio format. PCM = 1 (i.e. Linear quantization). Values other than 1 indicate some form of compression.

        Returns:
        The audio format.
      • getNumberOfChannels

        public final int getNumberOfChannels()

        Gets the number of channels.

        Returns:
        The number of channels.
      • getSampleRate

        public final int getSampleRate()

        Gets the sample rate.

        Returns:
        The sample rate.
      • getByteRate

        public final int getByteRate()

        Gets the byte rate.

        Returns:
        The byte rate.
      • getBlockAlign

        public final int getBlockAlign()

        Gets the block align.

        Returns:
        The block align.
      • getBitsPerSample

        public final int getBitsPerSample()

        Gets the bits per sample value.

        Returns:
        The bits per sample value.