(Page 38 of 80 in this chapter)
typedef struct
{ /* parms related to adiStartPlaying: */
DWORD size ; /* size of this structure */
DWORD DTMFabort; /* abort on DTMF; */
DWORD speed; /* initial speed in percent */
DWORD maxspeed; /* maximum play speed in percent */
} ADI_PLAY_PARMS;
int myPlayMemory( CTAHD ctahd, unsigned encoding,
void *buffer, unsigned bufsize )
{
ADI_EVENT event;
if( adiPlayFromMemory( ctahd, encoding, buffer, bufsize, NULL ) != SUCCESS)
return MYFAILURE;
do
{
myGetEvent( &event ); /* see adiFetchAndProcess example */
} while( event.id != ADIEVN_PLAY_DONE );
if( event.value == CTA_REASON_RELEASED )
return MYDISCONNECT; /* call has been terminated */
else if( IS_ADI_ERROR( event.value ) )
return MYFAILURE; /* API error */
else
return SUCCESS; /* stopped normally */
}
(Page 38 of 80 in this chapter)