Enum Class SamplingRate

java.lang.Object
java.lang.Enum<SamplingRate>
org.refcodes.audio.SamplingRate
All Implemented Interfaces:
Serializable, Comparable<SamplingRate>, Constable

public enum SamplingRate extends Enum<SamplingRate>
The SamplingRate enumeration defines some common sampling rates. Use getLowestSamplingRate() for the lowest sampling rate and getHigestSamplingRate() for the highest sampling rate. On a SamplingRate instance, use getNextHigherSamplingRate() for the next higher sampling rate and getPreviousLowerSamplingRate() for the previous lower sampling rate. See "https://github.com/audiojs/sample-rate"
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    44,100 Hz: Audio CD, most commonly used rate with MPEG-1 audio (VCD, SVCD, MP3).
    96,000 Hz: DVD-Audio, LPCM DVD tracks, Blu-ray audio tracks, HD DVD audio tracks.
    352,800 Hz Digital eXtreme Definition.
    176,400 Hz: Used in HDCD recorders and other professional applications for CD production.
    192,000 Hz: Used with audio on professional video equipment.
    88,200 Hz: Used by some professional recording equipment when the destination is CD, such as mixers, EQs, compressors, reverb, crossovers and recording devices.
    384,000 Hz: Highest sample rate available for common software.
    22,050 Hz: Used for lower-quality PCM and MPEG audio and for audio analysis of low frequency energy.
    11,025 Hz Used for lower-quality PCM, MPEG audio and for audio analysis of subwoofer bandpasses.
    48,000 Hz: Standard sampling rate used by professional digital video equipment, could reconstruct frequencies up to 22 kHz.
    8,000 Hz: Adequate for human speech but without sibilance.
    16,000 Hz: Used in most VoIP and VVoIP, extension of telephone narrowband.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the highest sampling rate.
    Retrieves the lowest sampling rate.
    Retrieves the next higher sampling rate or null if it is already the highest sampling rate.
    Retrieves the previous lower sampling rate or null if it is already the lowest sampling rate.
    int
    Returns the sampling rate in samples per second.
    Returns the enum constant of this class with the specified name.
    static SamplingRate[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • TELEPHONE

      public static final SamplingRate TELEPHONE
      8,000 Hz: Adequate for human speech but without sibilance. Used in telephone/walkie-talkie.
    • LOWEST_PCM

      public static final SamplingRate LOWEST_PCM
      11,025 Hz Used for lower-quality PCM, MPEG audio and for audio analysis of subwoofer bandpasses.
    • VOICE_OVER_IP

      public static final SamplingRate VOICE_OVER_IP
      16,000 Hz: Used in most VoIP and VVoIP, extension of telephone narrowband.
    • LOW_PCM

      public static final SamplingRate LOW_PCM
      22,050 Hz: Used for lower-quality PCM and MPEG audio and for audio analysis of low frequency energy.
    • AUDIO_CD

      public static final SamplingRate AUDIO_CD
      44,100 Hz: Audio CD, most commonly used rate with MPEG-1 audio (VCD, SVCD, MP3). Covers the 20 kHz bandwidth.
    • PROFESSIONAL

      public static final SamplingRate PROFESSIONAL
      48,000 Hz: Standard sampling rate used by professional digital video equipment, could reconstruct frequencies up to 22 kHz.
    • HIGHER_PROFESSIONAL

      public static final SamplingRate HIGHER_PROFESSIONAL
      88,200 Hz: Used by some professional recording equipment when the destination is CD, such as mixers, EQs, compressors, reverb, crossovers and recording devices.
    • DVD_AUDIO

      public static final SamplingRate DVD_AUDIO
      96,000 Hz: DVD-Audio, LPCM DVD tracks, Blu-ray audio tracks, HD DVD audio tracks.
    • HDC

      public static final SamplingRate HDC
      176,400 Hz: Used in HDCD recorders and other professional applications for CD production.
    • HIGH_PROFESSIONAL

      public static final SamplingRate HIGH_PROFESSIONAL
      192,000 Hz: Used with audio on professional video equipment. DVD-Audio, LPCM DVD tracks, Blu-ray audio tracks, HD DVD audio tracks.
    • EXTREME

      public static final SamplingRate EXTREME
      352,800 Hz Digital eXtreme Definition. Used for recording and editing Super Audio CDs.
    • HIGHEST

      public static final SamplingRate HIGHEST
      384,000 Hz: Highest sample rate available for common software. Allows for precise peak detection.
  • Method Details

    • values

      public static SamplingRate[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SamplingRate valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getSamplesPerSecond

      public int getSamplesPerSecond()
      Returns the sampling rate in samples per second.
      Returns:
      The samples per second for this SamplingRate.
    • getLowestSamplingRate

      public static SamplingRate getLowestSamplingRate()
      Retrieves the lowest sampling rate.
      Returns:
      The lowest sampling rate.
    • getHigestSamplingRate

      public static SamplingRate getHigestSamplingRate()
      Retrieves the highest sampling rate.
      Returns:
      The highest sampling rate.
    • getNextHigherSamplingRate

      public SamplingRate getNextHigherSamplingRate()
      Retrieves the next higher sampling rate or null if it is already the highest sampling rate.
      Returns:
      The next higher sampling rate or null if already the highest sampling rate.
    • getPreviousLowerSamplingRate

      public SamplingRate getPreviousLowerSamplingRate()
      Retrieves the previous lower sampling rate or null if it is already the lowest sampling rate.
      Returns:
      The previous lower sampling rate or null if already the lowest sampling rate.