|
|
User login
Feeds |
doubt on CMdaAudioRecorderUtility
|
|||||
| Wed, 2003-10-29 07:26 | |
|
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 |
|
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
Forum posts: 22
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
Refer Sound application in S60examples. If you are still stuck up somewhere, I will be glad to spare some time for this activity.
-void*
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
Forum posts: 38
with regards
Bharat Uppal