Hello,
I am using HMP 4.1 SU 18 running on Redhat 5.3
I am trying to record a wave file. However, the dx_recwav return an error "Function not implemented" Does this mean I cannot use this function on HMP 4.1 processing software?
Is my code incorrect?
Many thanks for any advice
static int32_t g_dx_recwav(const uint32_t port_num)
{
DV_TPT tpt;
DX_XPB xpb;
/* Open voice channel */
if((port[port_num].chdev = dx_open("dxxxB1C1", 0)) == -1)
log_msg(stderr, "dx_open [ %s ] [ %d ]\n", __func__, __LINE__);
return GC_FAILURE;
}
/* Clear the structure */
dx_clrtpt(&tpt, 1);
tpt.tp_type = IO_EOT;
tpt.tp_termno = DX_MAXDTMF;
tpt.tp_length = 1;
tpt.tp_flags = TF_MAXDTMF;
/* Specify file format */
xpb.wFileFormat = FILE_FORMAT_WAVE;
xpb.wDataFormat = DATA_FORMAT_PCM;
xpb.nSamplesPerSec = DRT_8KHZ;
xpb.wBitsPerSample = 16;
/* Start recording */
if(dx_recwav(port[port_num].chdev, "rec_test.wav", &tpt, &xpb, PM_TONE | EV_SYNC) == -1)
log_msg(stderr, "dx_recwav() reason: [ %s ] last err: [ %d ] function: [ %s ] line: [ %d ]\n",
ATDV_ERRMSGP(port[port_num].chdev), ATDV_LASTERR(port[port_num].chdev), __func__, __LINE__);
return GC_SUCCESS;
That's interesting because it is listed in the Voice Library guide:
http://www.dialogic.com/manuals/docs/voice_api_hmp_v6.pdf
Your error code is pretty specific, so I am wondering if this was not implemented in HMP 4.1 and perhaps it is in the guide incorrectly, possibly due to a copy/paste error. I suggest using dx_reciottdata() instead -- that function is always included in all releases. If you get the same error, then there is likely a problem with the code ... If the error goes away then it appears to be an error in the doc (as the fucntion would not be supported).
Good luck!