Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

hi,

i am using IMedia for recording

i can record voice in a .qcp file.

but i want to record it in a buffer.......

i am using following code for this.......

/******************************************************************************************/

 

    AEEMediaData  md;

    int nErr;

ISHELL_CreateInstance(pMe->piShell, AEECLSID_MEDIAPCM, (void**)&pMe->m_pMedia_for_recording);

ISHELL_CreateInstance(pMe->piShell, AEECLSID_FILEMGR,(void**)&(pMe->m_pIFileMgr));

pMe->m_pIFile=IFILEMGR_OpenFile(pMe->m_pIFileMgr, "sound.mp3",_OFM_READ);

IFILE_GetInfo(pMe->m_pIFile,&pMe->m_FileInfo);

pMe->BufferRec=MALLOC(sizeof(char)*pMe->m_FileInfo.dwSize);

IFILE_Read(pMe->m_pIFile, (void*)pMe->BufferRec,pMe->m_FileInfo.dwSize);

    md.clsData = MMD_BUFFER;

    md.pData   = pMe->BufferRec;

    md.dwSize  = pMe->m_FileInfo.dwSize;

    nErr = IMedia_SetMediaData(pMe->m_pMedia_for_recording, &md);

    nErr = IMedia_RegisterNotify(pMe->m_pMedia_for_recording,(PFNMEDIANOTIFY)Media_CB, pMe);

    nErr = IMedia_Record(pMe->m_pMedia_for_recording);/*return 20*/

/******************************************************************************************/

but IMedia_Record return 20.

& if i record in file then work fine.

plz show me wright way.....