Plays a tone to all members of the conference.
DWORD cnfStartTone ( CNFRESOURCEHD reshd, DWORD confid, CNF_TONE_PARMS *parms)
|
Argument |
Description |
|
reshd |
Resource handle returned by cnfOpenResource. |
|
confid |
Conference identifier returned by cnfCreateConference. |
|
parms |
Pointer to a CNF_TONE_PARMS structure: typedef struct Refer to CNF.TONE for a description of these fields. |
|
Return value |
Description |
|
SUCCESS |
|
|
CTAERR_BOARD_ERROR |
Tone cannot be generated because the board stopped responding. |
|
CTAERR_INVALID_HANDLE |
reshd is not a valid conference handle. |
|
CNFERR_CONFERENCE_EMPTY |
Conference confid currently has no members. |
|
CNFERR_INVALID_IDENTIFIER |
confid is not a valid conference identifier. |
|
CNFERR_INVALID_PARAMETER |
parms is inconsistent or out of range. |
|
Event |
Description |
|
CNFEVN_TONE_DONE |
Tone generation completed or was stopped. Generated only if event_mask is set to CNF_EVNMSK_TONE_DONE when the function is called and the function returns SUCCESS. |
cnfStartTone plays a tone to all conference members to indicate that a new member is joining or leaving the conference. When this function is invoked, members stops hearing each other and hear only the tone.
If the iterations count is one (1), the tone is not complete until the offtime has expired. If the iterations count is more than one, then the final offtime is omitted.
To generate a tone continuously (forever), set iterations to -1 and specify an offtime of 0 (zero). Use cnfStopTone to terminate tone generation prematurely.
For more information, refer to Playing a tone.
extern CNFRESOURCEHD cnfresourcehd;
int myConferenceTone( DWORD confid )
{
CTA_EVENT event;
CNF_TONE_PARMS toneparms;
// Fill the tone structure
toneparms.size = sizeof(CNF_TONE_PARMS);
toneparms.freq1 = 1000;
toneparms.ampl1 = -20;
toneparms.freq2 = 500;
toneparms.ampl2 = -20;
toneparms.ontime = 200;
toneparms.offtime = 200;
toneparms.iterations = 2;
cnfStartTone ( cnfresourcehd, confid, &toneparms);
do
{
myGetEvent( &event ); /* see ctaWaitEvent example */
} while( event.id != CNFEVN_TONE_DONE );
if( CTA_IS_ERROR( event.value ) )
return MYFAILURE; /* API error */
else
return SUCCESS; /* started successfully */
}