×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    3

    CMdaAudioRecorderUtility problems

    Hi,

    In Nokia 6630, Today we use CMdaAudioRecorderUtility to record the data and it only allows to record in file. It does not allow to record in buffer, which means
    OpenDesL() does not work, only OpenFileL() works. But the same API was working in 6600. Is there a way to open the recorder in buffer mode?

    Also,
    In this file based recording, When we issue RecordL() on the recorder it comes back with a callback on MoscoStateChangeEvent from Open state to Recording state. The delay between the time when it called the
    callback and the time when data is available in the file is nearly around 2 seconds. This introduces
    lot of voice delay. Is this the expected behavior of the API?

    thanks
    Suresh.

  2. #2
    Regular Contributor
    Join Date
    Oct 2004
    Location
    Tokyo,Japan
    Posts
    289

    Its unavoidable hardware constraint

    HI suresh

    This delay is the behavior of hardware to get realised.

    When you open a file for recording , the reorder take some time to go to EOpen state . Best solution is to display a text message on screen like "Preparing herdware" just after issueing OpenL command on recorder and as you get EOpen state in MoscoStateChangeEvent() function , you issue record command and after some time the recorder goes into ERecording state as notified in the MoscoStateChangeEvent() function and then display a message like "Recording started" ,
    otherwise you can't avoid this delay.


    Hope this information may be helpful to you.

    Cheers
    Navjot Singh

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037
    Hi,

    some os versions have problems with recording into buffer, but it works when recording into file:

    AMR-encoded audio cannot be recorded to a descriptor on Series 60 Platform 2nd Edition, Feature Pack 1 devices (such as Nokia 7610 and Nokia 6260) using the CMdaAudioRecorderUtility::OpenDesL() method.

    On N6630 is should be solved...

    Bye
    STeN

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037
    Hi,

    I have also bad experiences with it. I tested recording into WAV files on emulator with this ununderstable result:

    OpenDesL() method has parameter TDes8& aDescriptor. I tried to put as parameter

    1) Member variable TBuf<KBufferSize> iWavBuffer.
    OpenDesL(iWavBuffer,...)
    IT WORKS

    2) Member variable TDes8* iWavBuffer. I simply initialized it by calling:
    iWavBuffer = new ( ELeave ) TBuf8<KBufferSize>
    OpenDesL(*iWavBuffer,...)
    and IT also WORKS. But it is practically the same as the previous in the case of member variables...

    3) But when trying to use HBufC8* in the way i did it many times before it fails....

    I defined two members. One to hold data and one for holding the pointer to them which will have life-time over method call.
    HBufC8* iWavBuffer;
    TPtr8 iWavBufferPtr;
    I initialized it by
    iWavBuffer = HBufC8::NewMaxL( KBufferSize );
    iWavBufferPtr.Set( iWavBuffer->Des() );
    iRecorder->OpenDesL( iWavBufferPtr,...)

    When MoscoStateChangeEvent was called it has parameter
    aCurrentState ENotReady and aErrorCode KErrNotFound.

    WAS ANYBODY SUCCESSFULL?

    Thanx for replies
    Bye
    STeN

  5. #5
    Registered User
    Join Date
    Aug 2005
    Location
    Bangalore
    Posts
    13

    Re: CMdaAudioRecorderUtility problems

    Hi Friends,
    I need some clarification regarding my recording utility. I am developing a utility which records a greeting message. And i will be waiting for an incomming call...when a call comes i need to play my recorded greeting, after that a beep and then start recording callers voice and stop after a min or when the caller hooks...
    Now can u tell me how to play, beep, record..How to wait untill the playing of greeting, beep and then start rec???
    can some one help me in this...i am a new bee...
    And can u tell tell how to hide the app after activating the auto answer mode and pull the app when a call comes...

    --Raju

  6. #6
    Regular Contributor
    Join Date
    Oct 2004
    Location
    Tokyo,Japan
    Posts
    289

    Re: CMdaAudioRecorderUtility problems

    Go through following steps :

    1) You need to use telephony features i.e. ETel APIs and create a .exe that always runs in background

    listening/monitoring inconming calls . RLine class provided methods like NotifyIncomingCall(),

    GetCallInfo() etc. On detecting incoming call , u need to execute a some ETel commands to pick up

    the phone i.e. invoking function Connect() on a RCall object .
    2) on connecting the call , u need to create an object of class
    i.e.
    CMdaAudioRecorderUtility iRecorder = CMdaAudioRecorderUtility::NewL();
    //@ pass your parameters to NewL()

    iRecorder->SetAudioDeviceMode(ETelephonyMixed);
    iRecorder->OpenFileL(path_of_ur_file_to_be_played);
    iState=EOpeningPlayTone;

    before this note that u must create an enumeration for the state engine of application
    i.e.

    //@ declare this enumeration in the header file
    enum AppState
    {
    EOpenedPlayTone,
    EPlayedPlayTone,
    EOpenedBeepTone,
    EPlayedBeepTone,
    EOpenedFileForRecording,
    ERecordedMessage,
    EIdle
    };


    create class member AppState iState;




    3) Note: your class whose member is iRecorder must implement the interface/Mixin observer

    MMdaObjectStateChangeObserver and the class must implement the method
    virtual void MoscoStateChangeEvent(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt

    aErrorCode) = 0;

    4) when the opening of file path_of_ur_file_to_be_played is completed the control goes to method
    MoscoStateChangeEvent(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
    {

    switch(iState)
    {
    case EOpenedPlayTone:
    iState=EPlayedPlayTone;
    iRecorder->PlayL();
    break;
    case EPlayedPlayTone :
    //@ control comes here when the playing of tone ends
    iRecorder->Close();//@ release the file
    iState=EOpenedBeepTone;
    iRecorder->OpenFileL(beep_tone_file_path);
    break;

    case EOpenedBeepTone:
    //@ control comes here when opening of beep tone file completes
    iState = EPlayedBeedTone;
    iRecorder->Play();
    break;

    case EPlayedBeedTone;
    //@ control comes here when the playing of beep tone ends

    iRecorder->Close();//@ release the file
    iState=EOpenedFileForRecording;
    iRecorder->OpenFileL(recording_file_path);
    break;

    case EOpenedFileForRecording :
    //@ contol comes here when recorder has openened the file for recording

    //@ start recording now and start a CPeriodic or RTimer with one minute elapse as u wish

    iRecorder->Record();
    /*

    i recommend u to use CPeriodic that calls up after one minute(your defined time period) and the

    callback must return '0' if u do not want the callback function to be executed after every one

    minute.
    so in callback function u must call 'iRecorder->Stop() and then iRecorder->Close()'

    otherwise u need to check if phone call has been disconnected and then call iRecorder->Stop() and

    the iRecorder->Close();

    */

    break;

    }
    }

    I hope this information will help you .

    Cheers
    kanda

  7. #7
    Registered User
    Join Date
    Aug 2005
    Location
    Bangalore
    Posts
    13

    Re: CMdaAudioRecorderUtility problems

    Hi Kanda,
    thank you very much for your detailed reply...
    Is there any great diff b/n the Recorder app's (provided by the nokia) RegisterLine() implementation with NotifyIncomingCall() and GetCallInfo()??? It(RegisterLine) doesnt implement any of your mentioned methods...
    If you can, please give me some infr about making an app as a exe???

    --Raju
    Last edited by murlee_a; 2005-09-09 at 10:01.

  8. #8
    Registered User
    Join Date
    Oct 2005
    Posts
    6

    Re: CMdaAudioRecorderUtility problems

    Quote Originally Posted by stenlik
    Hi,

    some os versions have problems with recording into buffer, but it works when recording into file:

    AMR-encoded audio cannot be recorded to a descriptor on Series 60 Platform 2nd Edition, Feature Pack 1 devices (such as Nokia 7610 and Nokia 6260) using the CMdaAudioRecorderUtility::OpenDesL() method.

    On N6630 is should be solved...

    Bye
    STeN
    I've done this on the 7610. You need to step up the codec for the descriptor with these values.

    const TUid KMMFExControllerUID = {0x101F5022};
    const TUid KMMFExDesFormatUID = {0x101FAF66};

    iMdaAudioRecorderUtility->OpenDesL(<descriptor>,KMMFExControllerUID,KMMFExControllerUID,KMMFExDesFormatUID,KMMFFourCCCodeAMR);

Posting Permissions

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