×

Discussion Board

Results 1 to 9 of 9

Thread: TRAPD error

  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Location
    "On a b'ful lil palnet called EARTH belongs wid Galaxy named MilkyWay in Universe"
    Posts
    402

    Post TRAPD error

    hi.. experts
    iRecorder = CMdaAudioRecorderUtility::NewL(*this, NULL, 80, EMdaPriorityPreferenceTime);
    TRAPD(error, iRecorder->RecordL());

    it gives me -5 error on 6681, means KErrNotSupported The operation requested is not supported, even its working fine on 3230 ..

    can anybody guide me wat to do....

    Thanx in advance...
    ===With Symbian===
    "Something Has Survived..!!!"

  2. #2
    Registered User
    Join Date
    Mar 2007
    Location
    INDIA
    Posts
    43

    Re: TRAPD error

    Hi,

    CMdaAudioRecorderUtility requires MMdaObjectStateChangeObserver to be implemented. It is used to update different states of the file playing/recording. File is ready to be played/recorded after this interface method is called with EOpen for the player object.

    Call RecordL only after successfully opening the file.

    You can find code snippet here:
    http://wiki.forum.nokia.com/index.ph...ng_audio_files

    Best regards,
    Kin

  3. #3
    Regular Contributor
    Join Date
    Mar 2007
    Location
    "On a b'ful lil palnet called EARTH belongs wid Galaxy named MilkyWay in Universe"
    Posts
    402

    Exclamation Re: TRAPD error

    Quote Originally Posted by kiranmudiyam View Post
    Hi,

    CMdaAudioRecorderUtility requires MMdaObjectStateChangeObserver to be implemented. It is used to update different states of the file playing/recording. File is ready to be played/recorded after this interface method is called with EOpen for the player object.

    Call RecordL only after successfully opening the file.

    You can find code snippet here:
    http://wiki.forum.nokia.com/index.ph...ng_audio_files

    Best regards,
    Kin
    Kiran. Thanx for responce.
    well my code is working on 3230 but is failing on 6681. nd for opening file i m using OpenFileL()... nd control is passing this function but not RecordL()
    ===With Symbian===
    "Something Has Survived..!!!"

  4. #4
    Registered User
    Join Date
    Mar 2007
    Location
    INDIA
    Posts
    43

    Re: TRAPD error

    Can you post your code here..

  5. #5
    Regular Contributor
    Join Date
    Mar 2007
    Location
    "On a b'ful lil palnet called EARTH belongs wid Galaxy named MilkyWay in Universe"
    Posts
    402

    Post Re: TRAPD error

    Quote Originally Posted by kiranmudiyam View Post
    Can you post your code here..
    yeah... its as follows..

    void CPhoneObserver::RecordVoiceL()
    {
    TBuf16<256> aRecordingFile;
    aRecordingFile.Copy(KFilesFolder);
    CreateFileForRecordingL(aRecordingFile);
    iRecorder = CMdaAudioRecorderUtility::NewL(*this, NULL, 80, EMdaPriorityPreferenceTime);
    iRecorder->OpenFileL(aRecordingFile);
    iRecorder->SetAudioDeviceMode( CMdaAudioRecorderUtility::ETelephonyNonMixed ); // even i have also tried ELOCAL etc..
    iRecorder->SetGain( iRecorder->MaxGain() );
    iRecorder->SetPosition(TTimeIntervalMicroSeconds(0));

    //iRecorder->CropL();
    iRecorder->RecordL(); //in Trap it giving -5
    }

    void CPhoneObserver::CreateFileForRecordingL(TDes& aFileName)
    {
    TBuf<30> aBuffer;
    TTime time;
    TDateTime aDateTime;
    time.UniversalTime();
    aDateTime=time.DateTime();
    aBuffer.Format(KFormatTxt, aDateTime.Year(), TInt(aDateTime.Month()+1), aDateTime.Day()+1, aDateTime.Hour(), aDateTime.Minute(), aDateTime.Second(), aDateTime.MicroSecond());
    aFileName.Append(aBuffer);
    aFileName.Append(_L(".wav"));
    }

    This is working on Nokia 3230. But not on 6670,6681,N72,N70,6630 etc..
    Last edited by Nitin SuperByte; 2007-11-01 at 10:55.
    ===With Symbian===
    "Something Has Survived..!!!"

  6. #6
    Regular Contributor
    Join Date
    Mar 2007
    Location
    "On a b'ful lil palnet called EARTH belongs wid Galaxy named MilkyWay in Universe"
    Posts
    402

    Unhappy Re: TRAPD error

    Quote Originally Posted by Nitin SuperByte View Post
    yeah... its as follows..

    void CPhoneObserver::RecordVoiceL()
    {
    TBuf16<256> aRecordingFile;
    aRecordingFile.Copy(KFilesFolder);
    CreateFileForRecordingL(aRecordingFile);
    iRecorder = CMdaAudioRecorderUtility::NewL(*this, NULL, 80, EMdaPriorityPreferenceTime);
    iRecorder->OpenFileL(aRecordingFile);
    iRecorder->SetAudioDeviceMode( CMdaAudioRecorderUtility::ETelephonyNonMixed ); // even i have also tried ELOCAL etc..
    iRecorder->SetGain( iRecorder->MaxGain() );
    iRecorder->SetPosition(TTimeIntervalMicroSeconds(0));

    //iRecorder->CropL();
    iRecorder->RecordL(); //in Trap it giving -5
    }

    void CPhoneObserver::CreateFileForRecordingL(TDes& aFileName)
    {
    TBuf<30> aBuffer;
    TTime time;
    TDateTime aDateTime;
    time.UniversalTime();
    aDateTime=time.DateTime();
    aBuffer.Format(KFormatTxt, aDateTime.Year(), TInt(aDateTime.Month()+1), aDateTime.Day()+1, aDateTime.Hour(), aDateTime.Minute(), aDateTime.Second(), aDateTime.MicroSecond());
    aFileName.Append(aBuffer);
    aFileName.Append(_L(".wav"));
    }

    This is working on Nokia 3230. But not on 6670,6681,N72

    Helloo folks... need ur help.. i m still facing same problem...
    ===With Symbian===
    "Something Has Survived..!!!"

  7. #7
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Bangalore, India
    Posts
    56

    Re: TRAPD error

    Quote Originally Posted by Nitin SuperByte View Post
    Recorder->SetAudioDeviceMode( CMdaAudioRecorderUtility::ETelephonyNonMixed ); // even i have also tried ELOCAL etc..
    Hi,

    CMdaAudioRecorderUtility::SetAudioDeviceMode This function is provided for binary compatibility, but does not have any effect from 7.0s. [This may not be the exact reason, but one thing I observed in your code snippet]
    Arun N R Nair

  8. #8
    Regular Contributor
    Join Date
    Mar 2007
    Location
    "On a b'ful lil palnet called EARTH belongs wid Galaxy named MilkyWay in Universe"
    Posts
    402

    Red face Re: TRAPD error

    Quote Originally Posted by arunnrnair View Post
    Hi,

    CMdaAudioRecorderUtility::SetAudioDeviceMode This function is provided for binary compatibility, but does not have any effect from 7.0s. [This may not be the exact reason, but one thing I observed in your code snippet]

    Sir a millions of tahnx for your consideration in my problem. Sir i also teried already this. I tried by remove
    iRecorder->SetAudioDeviceMode();
    or
    iRecorder->SetPosition(); // As yucca sir suggested in a post

    But no effect in result.. its same as b4.. -5 for RecordL()

    Please give me some fruitful responce, now this function is messing with me....
    ===With Symbian===
    "Something Has Survived..!!!"

  9. #9
    Registered User
    Join Date
    Mar 2007
    Location
    INDIA
    Posts
    43

    Re: TRAPD error

    As I said in my first reply do not do opening a file and recording in the same function. Opening a file may take time (in some devices atleast). If you call recordL b4 file opening you get -5 error.

    CMdaAudioRecorderUtility requires MMdaObjectStateChangeObserver to be implemented. It is used to update different states of the file playing/recording. File is ready to be played/recorded after this interface method is called with EOpen for the player object.

    Call RecordL only after successfully opening the file.

    You can find code snippet here:
    http://wiki.forum.nokia.com/index.ph...ng_audio_files

    Do call recording in the callback function as shown in the link.


    Br,
    Kin

Similar Threads

  1. XMl Parser Implementation for Symbian
    By ittiam in forum Symbian
    Replies: 26
    Last Post: 2009-09-16, 05:26
  2. i cant build helloworld project
    By akhin in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2008-12-22, 12:38
  3. please help cell id
    By perthachy in forum Symbian
    Replies: 12
    Last Post: 2007-07-10, 13:14
  4. S80 Platform SDK and Visual Studio .NET Linking Error
    By jayantjain in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2005-10-07, 22:14
  5. User break point error in Grid
    By ag24master in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-08-07, 08:20

Posting Permissions

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