- java.lang.Object
-
- java.lang.Enum<SamplingRate>
-
- org.refcodes.audio.SamplingRate
-
- All Implemented Interfaces:
Serializable
,Comparable<SamplingRate>
public enum SamplingRate extends Enum<SamplingRate>
TheSamplingRate
enumeration defines some common sampling rates. UsegetLowestSamplingRate()
for the lowest sampling rate andgetHigestSamplingRate()
for the highest sampling rate. On aSamplingRate
instance, usegetNextHigherSamplingRate()
for the next higher sampling rate andgetPreviousLowerSamplingRate()
for the previous lower sampling rate. See "https://github.com/audiojs/sample-rate"
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AUDIO_CD
44,100 Hz: Audio CD, most commonly used rate with MPEG-1 audio (VCD, SVCD, MP3).DVD_AUDIO
96,000 Hz: DVD-Audio, LPCM DVD tracks, Blu-ray audio tracks, HD DVD audio tracks.EXTREME
352,800 Hz Digital eXtreme Definition.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.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.HIGHEST
384,000 Hz: Highest sample rate available for common software.LOW_PCM
22,050 Hz: Used for lower-quality PCM and MPEG audio and for audio analysis of low frequency energy.LOWEST_PCM
11,025 Hz Used for lower-quality PCM, MPEG audio and for audio analysis of subwoofer bandpasses.PROFESSIONAL
48,000 Hz: Standard sampling rate used by professional digital video equipment, could reconstruct frequencies up to 22 kHz.TELEPHONE
8,000 Hz: Adequate for human speech but without sibilance.VOICE_OVER_IP
16,000 Hz: Used in most VoIP and VVoIP, extension of telephone narrowband.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SamplingRate
getHigestSamplingRate()
Retrieves the highest sampling rate.static SamplingRate
getLowestSamplingRate()
Retrieves the lowest sampling rate.SamplingRate
getNextHigherSamplingRate()
Retrieves the next higher sampling rate or null if it is already the highest sampling rate.SamplingRate
getPreviousLowerSamplingRate()
Retrieves the previous lower sampling rate or null if it is already the lowest sampling rate.int
getSamplesPerSecond()
Returns the sampling rate in samples per second.static SamplingRate
valueOf(String name)
Returns the enum constant of this type with the specified name.static SamplingRate[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 Detail
-
values
public static SamplingRate[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SamplingRate c : SamplingRate.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SamplingRate valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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
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.
-
-