36 PString Decode(
const short * sampleData, PINDEX numSamples,
unsigned mult = 1,
unsigned div = 1);
137 unsigned sampleRate = 0,
138 unsigned masterVolume = 0
151 unsigned milliseconds,
171 bool Juxtapose(
unsigned frequency1,
unsigned frequency2,
unsigned milliseconds,
unsigned volume);
172 bool Modulate (
unsigned frequency,
unsigned modulate,
unsigned milliseconds,
unsigned volume);
173 bool PureTone (
unsigned frequency,
unsigned milliseconds,
unsigned volume);
174 bool Silence (
unsigned milliseconds);
176 unsigned CalcSamples(
unsigned milliseconds,
unsigned frequency1,
unsigned frequency2 = 0);
178 void AddSample(
int sample,
unsigned volume);
205 const char * dtmf = NULL,
239 double frequency2 = 0,
286 #endif // PTLIB_DTMF_H
virtual PBoolean Write(const void *buf, PINDEX len)
Low level write to the channel.
void GenerateDialTone()
Generate PCM data for 1 second of US standard dial tone of 350/440hz.
Definition: dtmf.h:256
int h[NumTones]
Definition: dtmf.h:50
virtual PBoolean SetSize(PINDEX newSize)
Set the size of the array in elements.
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:2164
char key[256]
Definition: dtmf.h:44
this class can be used to generate PCM data for DTMF tones at a sample rate of 8khz ...
Definition: dtmf.h:194
PDTMFEncoder(const char *dtmf=NULL, unsigned milliseconds=DefaultToneLen)
Create PCM data for the specified DTMF sequence.
bool Write(PChannel &channel)
Write tones to channel.
Definition: dtmf.h:156
int p1[NumTones]
Definition: dtmf.h:47
This class can be used to generate PCM data for tones (such as telephone calling tones and DTMF) at a...
Definition: dtmf.h:103
unsigned m_sampleRate
Definition: dtmf.h:180
int inputAmplitude
Definition: dtmf.h:51
void GenerateBusyTone()
Generate PCM data for a single cadence of the US standard busy tone of 480/620hz for 1/2 second...
Definition: dtmf.h:265
PTones(unsigned masterVolume=MaxVolume, unsigned sampleRate=DefaultSampleRate)
Create an empty tone buffer.
void AddTone(const char *str, unsigned milliseconds=DefaultToneLen)
Add the PCM data for the specified tone sequence to the buffer.
char DtmfChar(PINDEX i)
Convenience function to get the ASCII character for a DTMF index, where the index varies from 0 to 15...
void SetSampleRate(unsigned rate)
Set sample rate for tones, note will clear tone buffer.
int sampleCount
Definition: dtmf.h:51
int k[NumTones]
Definition: dtmf.h:50
unsigned m_masterVolume
Definition: dtmf.h:182
bool Generate(const PString &descriptor, unsigned sampleRate=0, unsigned masterVolume=0)
Generate a tone using the specified descriptor.
void AddSample(int sample, unsigned volume)
Abstract class defining I/O channel semantics.
Definition: channel.h:103
bool Juxtapose(unsigned frequency1, unsigned frequency2, unsigned milliseconds, unsigned volume)
virtual PINDEX GetSize() const
Get the current size of the container.
bool PBoolean
Definition: object.h:174
unsigned m_lastFrequency2
Definition: dtmf.h:184
int m_angle2
Definition: dtmf.h:185
PINDEX m_addPosition
Definition: dtmf.h:186
The character string class.
Definition: pstring.h:108
int m_angle1
Definition: dtmf.h:185
const void * GetPointer() const
Definition: array.h:204
unsigned m_maxFrequency
Definition: dtmf.h:181
unsigned GetSampleRate() const
Get the sample rate for tones.
Definition: dtmf.h:161
bool PureTone(unsigned frequency, unsigned milliseconds, unsigned volume)
int tonesDetected
Definition: dtmf.h:51
char m_lastOperation
Definition: dtmf.h:183
unsigned CalcSamples(unsigned milliseconds, unsigned frequency1, unsigned frequency2=0)
unsigned m_lastFrequency1
Definition: dtmf.h:184
int y[NumTones]
Definition: dtmf.h:50
This template class maps the PAbstractArray to a specific element type.
Definition: array.h:504
bool Silence(unsigned milliseconds)
void GenerateRingBackTone()
Generate PCM data for a single cadence of the US standard ring tone of 440/480hz for 2 seconds...
Definition: dtmf.h:247
PString Decode(const short *sampleData, PINDEX numSamples, unsigned mult=1, unsigned div=1)
bool Modulate(unsigned frequency, unsigned modulate, unsigned milliseconds, unsigned volume)
Ultimate parent class for all objects in the class library.
Definition: object.h:2204