#include <audio2.h>
Inheritance diagram for ost::AudioTone:
Public Member Functions | |
Rate | getRate (void) |
Get the sample encoding rate being used for the tone generator. | |
size_t | getSamples (void) |
Get the frame size for the number of audio samples generated. | |
bool | isSilent (void) |
Test if the tone generator is currently set to silence. | |
virtual Linear | getFrame (void) |
Iterate the tone frame, and extract linear samples in native frame. | |
unsigned | getFrames (Linear buffer, unsigned number) |
This is used to copy one or more pages of framed audio quickly to an external buffer. | |
virtual bool | isComplete (void) |
See if at end of tone. | |
AudioTone (timeout_t duration=20, Rate rate=rate8khz) | |
Construct a silent tone generator of specific frame size. | |
AudioTone (unsigned f1, unsigned f2, Level l1, Level l2, timeout_t duration=20, Rate sample=rate8khz) | |
Construct a dual tone frame generator. | |
AudioTone (unsigned freq, Level level, timeout_t duration=20, Rate sample=rate8khz) | |
Construct a single tone frame generator. | |
virtual | ~AudioTone () |
Protected Member Functions | |
void | silence (void) |
Set the frame to silent. | |
void | reset (void) |
Reset the tone generator completely. | |
void | cleanup (void) |
Cleanup for virtual destructors to use. | |
void | single (unsigned freq, Level level) |
Set frame to generate single tone. | |
void | dual (unsigned f1, unsigned f2, Level l1, Level l2) |
Set frame to generate dual tone. | |
Protected Attributes | |
Rate | rate |
unsigned | samples |
Linear | frame |
double | df1 |
double | df2 |
double | p1 |
double | p2 |
Level | m1 |
Level | m2 |
bool | silencer |
The frame will be iterated for each request, so a continual tone can be extracted by frame.
|
Construct a silent tone generator of specific frame size.
|
|
Construct a dual tone frame generator.
|
|
Construct a single tone frame generator.
|
|
|
|
Cleanup for virtual destructors to use.
|
|
Set frame to generate dual tone. ..
|
|
Iterate the tone frame, and extract linear samples in native frame. If endian flag passed, then convert for standard endian representation (byte swap) if needed.
Reimplemented in ost::TelTone, ost::DTMFTones, and ost::MFTones. |
|
This is used to copy one or more pages of framed audio quickly to an external buffer.
|
|
Get the sample encoding rate being used for the tone generator.
|
|
Get the frame size for the number of audio samples generated.
|
|
See if at end of tone. This is used for non-continues audio tones, or to detect "break" events.
Reimplemented in ost::TelTone, ost::DTMFTones, and ost::MFTones. |
|
Test if the tone generator is currently set to silence.
|
|
Reset the tone generator completely. Produces silence., |
|
Set the frame to silent.
|
|
Set frame to generate single tone. ..
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|