Loading...
Searching...
No Matches
VPB_TONE Struct Reference
Public API functions » Port initialisation » Card information » Port control » Event handling » Audio play and record » Error handling » Programmable tone generator

Tone definition structure. More...

`#include <vpbapi.h>`

Collaboration diagram for VPB_TONE:

## Public Attributes

unsigned short | freq1
| frequency of first tone in `Hz`
unsigned short | freq2
| frequency of second tone in `Hz`
unsigned short | freq3
| frequency of third tone in `Hz`
float | level1
| first tone level in dB, `-inf` to `0dB`
float | level2
| second tone level in dB, `-inf` to `0dB`
float | level3
| third tone level in dB, `-inf` to `0dB`
unsigned long | ton
| on time in `ms`, if 0 tone is continuous
unsigned long | toff
| off time in `ms`
VPB_TONE * | next
| Pointer to the next tone in a sequence.

## Detailed Description

Tone definition structure.

This structure is used to define tone data for the programmable tone generator.

For example:

// A single continuous tone
VPB_TONE au_dial = { 400, 425, 450, -13, -13, -13, 0, 0, NULL };
// A two cadence continuous tone
VPB_TONE au_ring2 = { 400, 425, 450, -13, -13, 0, 400, 2000, &au_ring2 };
VPB_TONE au_ring = { 400, 425, 450, -13, -13, 0, 400, 200, &au_ring2 };
// A three tone one-shot sequence
VPB_TONE us_sit2 = { 1800, 0, 0, -13, 0, 0, 330, 0, NULL };
VPB_TONE us_sit1 = { 1400, 0, 0, -13, 0, 0, 330, 0, &us_sit2 };
VPB_TONE us_sit = { 950, 0, 0, -13, 0, 0, 330, 0, &us_sit1 };
vpb_playtone_sync(h, au_dial);
vpb_playtone_sync(h, au_ring);
vpb_playtone_sync(h, us_sit);
vpb_playtone_sync
int WINAPI vpb_playtone_sync(int handle, const VPB_TONE &vpb_tone)
Play a user defined tone, return when playback completes.
Definition vpbdial.cpp:517
VPB_TONE
Tone definition structure.
Definition vpbapi.h:1463