doubt on CMdaAudioRecorderUtility

Login to reply to this topic.
Wed, 2003-10-29 07:26
Joined: 2003-10-14
Forum posts: 14
Hello,

I am trying a simple voice streaming application. I am facing a problem here. I am recording voice and storing it in a file. I am initializing CMdaAudioRecorderUtility for this. Now I am trying to play the recorded voice. I am reading the entire chunk from the file into a descriptor and trying to play it. For this I am again initializing  CMdaAudioRecorderUtility
and opening a descriptor using OpenDesL(). But the application doesn't come up. It is closed as soon as I click on the application.

I am trying to do something like this.

_LIT(KRecorderFile, "C:\\System\\Apps\\Sound\\record.wav");

class A
{
 CMdaAudioRecorderUtility* iForPlay;
 CMdaAudioRecorderUtility* iForRecord;
};

and I initialize them as follows:

void A::ConstructL()
{
    iForRecord = CMdaAudioRecorderUtility::NewL(*this);
    iForRecord->OpenFileL(KRecorderFile);

    iBuffer = new(ELeave) TBuf8<2048>; //TDes8* iBuffer
    iBuffer->SetMax();

    iForPlay = CMdaAudioRecorderUtility::NewL(*this);
    iForPlay->OpenDesL(*iBuffer); //The application is closed here.
                                                 //It doesnot give any panic             code. It says "program
                                                //closed Sockets".

Is there a problem here? Am I missing out something here.

Can someone plese give me some suggestions.

Thanks in advance,
Karen

Mon, 2005-01-10 14:05
Amrik Rohella (not verified)
Forum posts: 2043
doubt on CMdaAudioRecorderUtility
Hi
You can solve your problem by using CMdaAudioPlayerUtility class. I am also using the same class to play form the buffer. For this u need to fill ur buffer, this can be done by reading from file. U can read any thing form file into descriptor.

I am suer this will solev ur problem.

Please let me know if u still find any problem. Also let me know if u r able to record in descriptor Or play from descriptor.

Thx & Rgds,
Amrik Rohella
Tue, 2005-01-11 09:34
Joined: 2004-11-08
Forum posts: 22
Re: doubt on CMdaAudioRecorderUtility
Hi,
  I am not sure I've understood your problem fully. IS it like you are using the same utility class ( CMdaAudioRecorderUtility ) for recording and playing. Ofcourse, you can very well use it.  In that case you need not to read a file into a descriptor. Once you have recorded the voice data to a file using RecordL(), simply call PlayL(). It will play from the same file what you have opened during recording using OpenFileL().
From your code it is clear that in ConstructL you are calling both OpenFileL() and OpenDescL() using two different recorder utility object. I am not sure thats gonna work ( i haven't tried this trick myself Wink ) You can use the same recorder utility object and openFileL(). Then first record the data and paly the same.

Refer Sound application in S60examples. If you are still stuck up somewhere, I will be glad to spare some time for this activity.

-void*


Quote from: Karen
Hello,

I am trying a simple voice streaming application. I am facing a problem here. I am recording voice and storing it in a file. I am initializing CMdaAudioRecorderUtility for this. Now I am trying to play the recorded voice. I am reading the entire chunk from the file into a descriptor and trying to play it. For this I am again initializing  CMdaAudioRecorderUtility
and opening a descriptor using OpenDesL(). But the application doesn't come up. It is closed as soon as I click on the application.

I am trying to do something like this.

_LIT(KRecorderFile, "C:\\System\\Apps\\Sound\\record.wav");

class A
{
 CMdaAudioRecorderUtility* iForPlay;
 CMdaAudioRecorderUtility* iForRecord;
};

and I initialize them as follows:

void A::ConstructL()
{
    iForRecord = CMdaAudioRecorderUtility::NewL(*this);
    iForRecord->OpenFileL(KRecorderFile);

    iBuffer = new(ELeave) TBuf8<2048>; //TDes8* iBuffer
    iBuffer->SetMax();

    iForPlay = CMdaAudioRecorderUtility::NewL(*this);
    iForPlay->OpenDesL(*iBuffer); //The application is closed here.
                                                 //It doesnot give any panic             code. It says "program
                                                //closed Sockets".

Is there a problem here? Am I missing out something here.

Can someone plese give me some suggestions.

Thanks in advance,
Karen
Fri, 2006-12-01 11:38
Joined: 2005-08-26
Forum posts: 38
Re: doubt on CMdaAudioRecorderUtility
Hi every body  Actually  i  am  try to make  a recorder application in uiq3    and  I  was successful   when  I  used  the  openfileL()   api of CMdaRecorderUtility  bit when  I   used    OpendesL  of CMdaRecorderUtility    the  program   leaves with   -5   which is  not supported I  am  using  P990 to test  my application


with regards
Bharat Uppal
  • Login to reply to this topic.