×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    11

    Unhappy problem in CMdaAudioRecorderUtility

    i have been asked to make a project on S80 using C++ for vioce verfication, and i dont know where to start, since i had no experince in programming on symbian.
    the only clue i have found was the CMdaAudioRecorderUtility class, but i couldn't create an object from it with this line:

    Code:
    CMdaAudioRecorderUtility* recorder=CMdaAudioRecorderUtility::NewL(*this);
    can anyone please help me, any documentation or examples would be very appreciated!

  2. #2
    Registered User
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113

    Re: problem in CMdaAudioRecorderUtility

    What do you mean by "voice verification" - it is a very broad topic.

    If you mean, biometric identification of a user (saying words instead of typing password), than there is no platform support for it. You can record voice, but you'll have to apply own recognition algorithms

  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    11

    Re: problem in CMdaAudioRecorderUtility

    well, i am already writing my recognition algorithm code, the problem is in recording, and accessing the recorded file as an array.
    i need help in these two things:
    1.how to record for fixed period (2~3 seconds)
    2.how to access that recording as an array.

    and many thanx for replying

  4. #4
    Registered User
    Join Date
    Jan 2006
    Posts
    11

    Unhappy Re: problem in CMdaAudioRecorderUtility

    well i partially succeeded in recording with one single problem
    Code:
    void CRecorderAdapter::ConstructL()
    {
        iMdaAudioRecorderUtility = CMdaAudioRecorderUtility::NewL(*this);
        iMdaAudioRecorderUtility->OpenFileL(KRecorderFile);
    }
    Code:
    void CRecorderAdapter::RecordL()
    {
    // Record from the device microphone
        iMdaAudioRecorderUtility->SetAudioDeviceMode(CMdaAudioRecorderUtility::ELocal);
        // Set maximum gain for recording
        iMdaAudioRecorderUtility->SetGain(iMdaAudioRecorderUtility->MaxGain());    
        // Delete current audio sample from beginning of file
        iMdaAudioRecorderUtility->SetPosition(TTimeIntervalMicroSeconds(0));
        iMdaAudioRecorderUtility->CropL();
        iMdaAudioRecorderUtility->SetMaxWriteLength(48000);
        iMdaAudioRecorderUtility->RecordL();
    }
    this code records but only once, and if i want to record again i must restart the program
    2nd problem is that i dont know how to access that file as an array
    hope any one responds as fast as possible, 8 days remaining to finish the project

  5. #5
    Registered User
    Join Date
    Jan 2006
    Posts
    11

    Unhappy Re: problem in CMdaAudioRecorderUtility

    this is the best i could do till now
    i need help please
    here is my work, but it did not record
    i hope someone tells me what's the problem

    Code:
    class CHelloWorldBasicAppView;
    _LIT(aFileI,"C:\\System\\Apps\\HelloWorldBasic\\play.wav");
    _LIT(aFileO,"C:\\System\\Apps\\HelloWorldBasic\\temp.wav");
    class CHelloWorldBasicAppUi : public CEikAppUi, public MMdaAudioPlayerCallback,
     public MMdaObjectStateChangeObserver
    {
    public:
    	void ConstructL();
    	CHelloWorldBasicAppUi();
    	~CHelloWorldBasicAppUi();
    public:
    	void HandleCommandL(TInt aCommand);
    public:
    	void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration){}
    	void MapcPlayComplete(TInt aError){}
    public:
    	void MoscoStateChangeEvent(CBase* aObject,TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
    	{
    		iRecorder->Close();              //i also tried using iPlayer
    		iRecorder->OpenFileL(aFileO);//in this method instead of
    		iRecorder->PlayL();              //iRecorder, but sure it didnt
    	}                                      //work since the o/p file is currupted
    	void PlayL()
    	{
    		iPlayer->OpenFileL(aFileI);
    		iPlayer->SetVolume(iPlayer->MaxVolume());
    		iPlayer->SetPosition(TTimeIntervalMicroSeconds(0));
    		iPlayer->Play();
    	}
    	void RecordL() //this method is not working correctly
    	{                  //and the output file is currepted
    		iRecorder->OpenFileL(aFileO);
    		iRecorder->SetAudioDeviceMode(CMdaAudioRecorderUtility::ELocal);
    		iRecorder->SetGain(iRecorder->MaxGain());
    		iRecorder->SetPosition(TTimeIntervalMicroSeconds(0));
    		iRecorder->CropL();
    //		iRecorder->SetMaxWriteLength(102400);
    		iRecorder->RecordL();
    	}
    	void StopL()
    	{
    		iPlayer->Stop();
    		iRecorder->Stop();
    	}
    private:
    	CHelloWorldBasicAppView* iAppView;
    private:
    	CMdaAudioPlayerUtility* iPlayer;
    	CMdaAudioRecorderUtility* iRecorder;
    };
    #endif

    Code:
    void CHelloWorldBasicAppUi::ConstructL()
    {
        BaseConstructL();
    	iAppView = CHelloWorldBasicAppView::NewL(ClientRect());
    	AddToStackL(iAppView);
    	iPlayer = CMdaAudioPlayerUtility::NewL(*this);
    	iRecorder=CMdaAudioRecorderUtility::NewL(*this);
    }
    CHelloWorldBasicAppUi::CHelloWorldBasicAppUi()                              
    {}
    CHelloWorldBasicAppUi::~CHelloWorldBasicAppUi()
    {
        if (iAppView)
    	{
            iEikonEnv->RemoveFromStack(iAppView);
            delete iAppView;
            iAppView = NULL;
    	}
    	delete iPlayer;
    	iPlayer=NULL;
    	delete iRecorder;
    	iRecorder=NULL;
    }

Similar Threads

  1. problem when stop playing video on 3650 and try to play again
    By niko86 in forum Mobile Java General
    Replies: 5
    Last Post: 2007-08-03, 07:40
  2. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  3. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  4. CMdaAudioRecorderUtility problem...
    By _nomad_ in forum Symbian Media (Closed)
    Replies: 7
    Last Post: 2006-03-06, 13:35
  5. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×