- All Implemented Interfaces:
Serializable
,Comparable<SamplingRate>
,Constable
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 ConstantDescription44,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 TypeMethodDescriptionstatic SamplingRate
Retrieves the highest sampling rate.static SamplingRate
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.static SamplingRate
Returns the enum constant of this class with the specified name.static SamplingRate[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TELEPHONE
8,000 Hz: Adequate for human speech but without sibilance. Used in telephone/walkie-talkie. -
LOWEST_PCM
11,025 Hz Used for lower-quality PCM, MPEG audio and for audio analysis of subwoofer bandpasses. -
VOICE_OVER_IP
16,000 Hz: Used in most VoIP and VVoIP, extension of telephone narrowband. -
LOW_PCM
22,050 Hz: Used for lower-quality PCM and MPEG audio and for audio analysis of low frequency energy. -
AUDIO_CD
44,100 Hz: Audio CD, most commonly used rate with MPEG-1 audio (VCD, SVCD, MP3). Covers the 20 kHz bandwidth. -
PROFESSIONAL
48,000 Hz: Standard sampling rate used by professional digital video equipment, could reconstruct frequencies up to 22 kHz. -
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
96,000 Hz: DVD-Audio, LPCM DVD tracks, Blu-ray audio tracks, HD DVD audio tracks. -
HDC
176,400 Hz: Used in HDCD recorders and other professional applications for CD production. -
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
352,800 Hz Digital eXtreme Definition. Used for recording and editing Super Audio CDs. -
HIGHEST
384,000 Hz: Highest sample rate available for common software. Allows for precise peak detection.
-
-
Method Details
-
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
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 nameNullPointerException
- 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
Retrieves the lowest sampling rate.- Returns:
- The lowest sampling rate.
-
getHigestSamplingRate
Retrieves the highest sampling rate.- Returns:
- The highest sampling rate.
-
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
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.
-