public class DTMFInbandTone
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static DTMFInbandTone |
DTMF_INBAND_0
The "0" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_1
The "1" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_2
The "2" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_3
The "3" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_4
The "4" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_5
The "5" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_6
The "6" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_7
The "7" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_8
The "8" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_9
The "9" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_A
The "A" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_B
The "B" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_C
The "C" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_D
The "D" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_SHARP
The "#" DTMF Inband Tone.
|
static DTMFInbandTone |
DTMF_INBAND_STAR
The "*" DTMF Inband Tone.
|
Constructor and Description |
---|
DTMFInbandTone(java.lang.String value,
double frequency1,
double frequency2)
Creates a new instance of an inband tone.
|
Modifier and Type | Method and Description |
---|---|
double |
getAudioSampleContinuous(double samplingFrequency,
int sampleNumber)
Generates a sample for the current tone signal.
|
int |
getAudioSampleDiscrete(double samplingFrequency,
int sampleNumber,
int sampleSizeInBits)
Generates a sample for the current tone signal converted into a discrete
signal.
|
short[] |
getAudioSamples(double sampleRate,
int sampleSizeInBits)
Generates a signal sample for the current tone signal and stores it into
the byte data array.
|
double |
getFrequency1()
Returns the first frequency coded by this tone.
|
double |
getFrequency2()
Returns the second frequency coded by this tone.
|
java.lang.String |
getValue()
Returns this tone value as a string representation.
|
static DTMFInbandTone |
mapTone(DTMFTone tone)
Maps between protocol and media inband DTMF objects.
|
public static final DTMFInbandTone DTMF_INBAND_0
public static final DTMFInbandTone DTMF_INBAND_1
public static final DTMFInbandTone DTMF_INBAND_2
public static final DTMFInbandTone DTMF_INBAND_3
public static final DTMFInbandTone DTMF_INBAND_4
public static final DTMFInbandTone DTMF_INBAND_5
public static final DTMFInbandTone DTMF_INBAND_6
public static final DTMFInbandTone DTMF_INBAND_7
public static final DTMFInbandTone DTMF_INBAND_8
public static final DTMFInbandTone DTMF_INBAND_9
public static final DTMFInbandTone DTMF_INBAND_STAR
public static final DTMFInbandTone DTMF_INBAND_SHARP
public static final DTMFInbandTone DTMF_INBAND_A
public static final DTMFInbandTone DTMF_INBAND_B
public static final DTMFInbandTone DTMF_INBAND_C
public static final DTMFInbandTone DTMF_INBAND_D
public DTMFInbandTone(java.lang.String value, double frequency1, double frequency2)
value
- The identifier of the tone. Available values are (0, 1, 2,
3, 4, 5, 6, 7, 8, 9, *, #, A, B, C and D).frequency1
- The first frequency which composes the tone. Available
values corresponds to DTMFInbandTone.frequencyList1.frequency2
- The second frequency which composes the tone. Available
values corresponds to DTMFInbandTone.frequencyList2.public java.lang.String getValue()
public double getFrequency1()
public double getFrequency2()
public double getAudioSampleContinuous(double samplingFrequency, int sampleNumber)
samplingFrequency
- The sampling frequency (codec clock rate) in Hz
of the stream which will encapsulate this signal.sampleNumber
- The sample number of this signal to be produced. The
sample number corresponds to the abscissa of the signal function.public int getAudioSampleDiscrete(double samplingFrequency, int sampleNumber, int sampleSizeInBits)
samplingFrequency
- The sampling frequency (codec clock rate) in Hz
of the stream which will encapsulate this signal.sampleNumber
- The sample number of this signal to be produced. The
sample number corresponds to the abscissa of the signal function.sampleSizeInBits
- The size of each sample (8 for a byte, 16 for a
short and 32 for an int)public short[] getAudioSamples(double sampleRate, int sampleSizeInBits)
sampleRate
- The sampling frequency (codec clock rate) in Hz of the
stream which will encapsulate this signal.sampleSizeInBits
- The size of each sample (8 for a byte, 16 for a
short and 32 for an int)public static DTMFInbandTone mapTone(DTMFTone tone)
tone
- The DTMF tone as defined in the service protocol, which is
only composed by a value as its identifier.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.