Enum Class ChannelMode

java.lang.Object
java.lang.Enum<ChannelMode>
com.tino1b2be.dtmf.ChannelMode
All Implemented Interfaces:
Serializable, Comparable<ChannelMode>, Constable

public enum ChannelMode extends Enum<ChannelMode>
How an incoming sample array should be interpreted as one or more audio channels for DTMF detection.

The three cases directly correspond to Requirement 13.1 and drive the branch in DtmfDetector / DtmfDecoder that selects between a single-pipeline and dual-pipeline analysis topology:

  • MONO — treat the sample array as a single channel; emitted tones carry channel = 0.
  • STEREO_INDEPENDENT — treat the sample array as interleaved left/right PCM, decode each channel independently, and tag emissions with channel = 0 (left, even indices) or channel = 1 (right, odd indices).
  • STEREO_DOWNMIX — average adjacent left/right samples into a single mono stream before detection; emitted tones carry channel = 0.

Used as the channelMode value of DtmfConfig.

Since:
2.0.0
  • Enum Constant Details

    • MONO

      public static final ChannelMode MONO
      Single-channel input; all emitted tones carry channel = 0.
    • STEREO_INDEPENDENT

      public static final ChannelMode STEREO_INDEPENDENT
      Interleaved stereo input decoded as two independent channels. Emitted tones carry channel = 0 for the left channel (even sample indices) and channel = 1 for the right channel (odd sample indices).
    • STEREO_DOWNMIX

      public static final ChannelMode STEREO_DOWNMIX
      Interleaved stereo input averaged into a single mono stream before detection. Emitted tones carry channel = 0.
  • Method Details

    • values

      public static ChannelMode[] 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 ChannelMode 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