Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Tone

A DTMF (telephone-event) tone.

Hierarchy

  • Tone

Index

Constructors

constructor

  • new Tone(): Tone
  • new Tone(value: string): Tone
  • new Tone(value: string, duration: number): Tone
  • Initializes a new instance of the fm.icelink.dtmf.tone class.
    Initializes a new instance of the fm.icelink.dtmf.tone class.

    Returns Tone

  • Initializes a new instance of the fm.icelink.dtmf.tone class.

    Parameters

    • value: string

      The value.

    Returns Tone

  • Initializes a new instance of the fm.icelink.dtmf.tone class.

    Parameters

    • value: string

      The value.

    • duration: number

      The duration.

    Returns Tone

Properties

Private _duration

_duration: number
internal

Private _remainingDuration

_remainingDuration: number
internal

Private _timestamp

_timestamp: number
internal

Private _value

_value: string
internal

Methods

clone

  • clone(): Tone
  • Clones this instance.

    Returns Tone

getDuration

  • getDuration(): number
  • Gets the duration in milliseconds.

    Returns number

getRemainingDuration

  • getRemainingDuration(): number
  • internal

    Returns number

getTimestamp

  • getTimestamp(): number
  • internal

    Returns number

getTypeString

  • getTypeString(): string
  • Returns string

getValue

  • getValue(): string
  • Gets the value.

    Returns string

setDuration

  • setDuration(value: number): void
  • internal

    Parameters

    • value: number

    Returns void

setRemainingDuration

  • setRemainingDuration(value: number): void
  • internal

    Parameters

    • value: number

    Returns void

setTimestamp

  • setTimestamp(value: number): void
  • internal

    Parameters

    • value: number

    Returns void

Private setValue

  • setValue(value: string): void
  • internal

    Parameters

    • value: string

    Returns void

toJson

  • toJson(): string
  • Serializes to JSON.

    Returns string

toString

  • toString(): string
  • Serializes to a string.

    Returns string

Static Private eventCodeFromValue

  • eventCodeFromValue(eventString: string): number
  • internal

    Parameters

    • eventString: string

    Returns number

Static fromJson

  • fromJson(toneJson: string): Tone
  • Deserializes from JSON.

    Parameters

    • toneJson: string

      The JSON.

    Returns Tone

Static fromJsonArray

  • fromJsonArray(tonesJson: string): Tone[]
  • Deserializes an array from JSON.

    Parameters

    • tonesJson: string

      The JSON.

    Returns Tone[]

Static fromToneString

  • fromToneString(toneString: string, duration: number, interToneGap: number): Tone[]
  • fromToneString(toneString: string): Tone[]
  • fromToneString(toneString: string, duration: number): Tone[]
  • Converts a DTMF tone string into an array of tones.

    Parameters

    • toneString: string

      The tone string.

    • duration: number

      The duration, in milliseconds (minimum of 40, maximum of 2,000).

    • interToneGap: number

      The time between tones, in milliseconds (minimum of 40).

    Returns Tone[]

  • Converts a DTMF tone string into an array of tones. Each tone will have a duration of 100ms and an inter-tone gap of 100ms.

    Parameters

    • toneString: string

      The tone string.

    Returns Tone[]

  • Converts a DTMF tone string into an array of tones. Each tone will have an inter-tone gap of 100ms.

    Parameters

    • toneString: string

      The tone string.

    • duration: number

      The duration, in milliseconds (minimum of 40, maximum of 2,000).

    Returns Tone[]

Static getA

  • getA(): Tone
  • Gets A tone.

    Returns Tone

Static getAValue

  • getAValue(): string
  • Gets the A value ("A").

    Returns string

Static getB

  • getB(): Tone
  • Gets the B tone.

    Returns Tone

Static getBValue

  • getBValue(): string
  • Gets the B value ("B").

    Returns string

Static getC

  • getC(): Tone
  • Gets the C tone.

    Returns Tone

Static getCValue

  • getCValue(): string
  • Gets the C value ("C").

    Returns string

Static getD

  • getD(): Tone
  • Gets the D tone.

    Returns Tone

Static getDValue

  • getDValue(): string
  • Gets the D value ("D").

    Returns string

Static getEight

  • getEight(): Tone
  • Gets the eight tone.

    Returns Tone

Static getEightValue

  • getEightValue(): string
  • Gets the eight value ("8").

    Returns string

Static getEmpty

  • getEmpty(): Tone
  • Gets the empty tone.

    Returns Tone

Static getEmptyValue

  • getEmptyValue(): string
  • Gets the empty value ("").

    Returns string

Static getFive

  • getFive(): Tone
  • Gets the five tone.

    Returns Tone

Static getFiveValue

  • getFiveValue(): string
  • Gets the five value ("5").

    Returns string

Static getFour

  • getFour(): Tone
  • Gets the four tone.

    Returns Tone

Static getFourValue

  • getFourValue(): string
  • Gets the four value ("4").

    Returns string

Static getHash

  • getHash(): Tone
  • Gets the hash tone.

    Returns Tone

Static getHashValue

  • getHashValue(): string
  • Gets the hash value ("#").

    Returns string

Static getNine

  • getNine(): Tone
  • Gets the nine tone.

    Returns Tone

Static getNineValue

  • getNineValue(): string
  • Gets the nine value ("9").

    Returns string

Static getOne

  • getOne(): Tone
  • Gets the one tone.

    Returns Tone

Static getOneValue

  • getOneValue(): string
  • Gets the one value ("1").

    Returns string

Static getPause

  • getPause(): Tone
  • Gets the pause tone.

    Returns Tone

Static getPauseDuration

  • getPauseDuration(): number
  • Gets the pause duration in milliseconds (2000).

    Returns number

Static getPauseValue

  • getPauseValue(): string
  • Gets the pause value (",").

    Returns string

Static getSeven

  • getSeven(): Tone
  • Gets the seven tone.

    Returns Tone

Static getSevenValue

  • getSevenValue(): string
  • Gets the seven value ("7").

    Returns string

Static getSix

  • getSix(): Tone
  • Gets the six tone.

    Returns Tone

Static getSixValue

  • getSixValue(): string
  • Gets the six value ("6").

    Returns string

Static getStar

  • getStar(): Tone
  • Gets the star tone.

    Returns Tone

Static getStarValue

  • getStarValue(): string
  • Gets the star value ("*").

    Returns string

Static getThree

  • getThree(): Tone
  • Gets the three tone.

    Returns Tone

Static getThreeValue

  • getThreeValue(): string
  • Gets the three value ("3").

    Returns string

Static getTwo

  • getTwo(): Tone
  • Gets the two tone.

    Returns Tone

Static getTwoValue

  • getTwoValue(): string
  • Gets the two value ("2").

    Returns string

Static getZero

  • getZero(): Tone
  • Gets the zero tone.

    Returns Tone

Static getZeroValue

  • getZeroValue(): string
  • Gets the zero value ("0").

    Returns string

Static toJson

  • toJson(tone: Tone): string
  • Serializes to JSON.

    Parameters

    • tone: Tone

    Returns string

Static toJsonArray

  • toJsonArray(tones: Tone[]): string
  • Serializes an array to JSON.

    Parameters

    • tones: Tone[]

      The array.

    Returns string

Static toToneString

  • toToneString(tones: Tone[]): string
  • Converts an array of DTMF tones into a tone string. This discards duration and inter-tone gap data.

    Parameters

    • tones: Tone[]

      The tones.

    Returns string

Static Private valueFromEventCode

  • valueFromEventCode(eventCode: number): string
  • internal

    Parameters

    • eventCode: number

    Returns string