Other Parts Discussed in Thread: OMAP3530
Hi all,
this is my first post. I defelop on a beagleboard with the OMAP3530. I try to get running the g722 Codec. The problem is that the decoded data is not correct. The engine starts and the codec decodes the file I give to it, but the result is not correct. The output file has the same size as the original file but I don't hear the voice, which should be. I hear some strange sounds :D The file which I try to decode is the file of the g722 package.
So hier is my code:
...
CERuntime_init();
Engine_Handle engineHandle = Engine_open(ENGINE_NAME,NULL,NULL);
ISPHDEC1_Params g722Params;
g722Params.size = sizeof(ISPHDEC1_Params);
g722Params.tablesPtr = NULL;
g722Params.codecSelection = 1;
g722Params.bitRate = 0;
SPHDEC1_Handle decoderHandle = SPHDEC1_create(engineHandle, SPHDECNAME,&g722Params);
Memory_AllocParams memparam = Memory_DEFAULTPARAMS;
memparam.type = Memory_CONTIGPOOL;
XDM1_SingleBufDesc inbuf;
inbuf.buf = (XDAS_Int8*) Memory_alloc(40*sizeof(XDAS_Int16), &memparam);
inbuf.bufSize =40*sizeof(XDAS_Int16);
XDM1_SingleBufDesc outbuf;
outbuf.buf = (XDAS_Int8*) Memory_alloc(160*sizeof(XDAS_Int16), &memparam);
outbuf.bufSize = 160*sizeof(XDAS_Int16);
ISPHDEC1_InArgs inArgs;
inArgs.size = sizeof(ISPHDEC1_InArgs);
inArgs.frameType = ISPHDEC1_FTYPE_SPEECHGOOD;
while(!feof(inFile))
{
inBytesRead = fread(inbuf.buf, sizeof(XDAS_Int16), 40, fin);
if (feof(fin))
{
printf("end of file\n");
break;
}
SPHDEC1_process(decoderHandle, &inbuffer, &outBuffer, &inargs, NULL);
fwrite(outbuf.buf, sizeof(XDAS_Int16), 160, fout);
}
...
So what is my mistake? Please help me!
Thanks
Nawata