×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    16

    Converting Wav File to raw format and storing in Descriptor

    Hi All,

    I am trying to Convert a ADPCM Format .Wav file to raw format. I have used CMdaAudioConvertUtility to do this.

    But I always get a KErrUnderflow error as errorcode in MoscoStateChangeEvent() callback function.

    Bellow is my code, Where am I going wrong.

    Code:

    _LIT(KSrcFileStream, "\\system\\apps\\simple\\test.wav");
    TBufC<64> tempstr(KSrcFileStream);

    iConverter = CMdaAudioConvertUtility::NewL(*this);
    iSoundBuf = HBufC8::New(50000);
    iClip.iDes = &(iSoundBuf->Des());
    iFormat = TMdaRawAudioClipFormat();
    iSl16Codec = TMdaSL16RawAudioCodec();

    iSettings.iSampleRate = TMdaAudioDataSettings::ESampleRate8000Hz;
    iSettings.iChannels = TMdaAudioDataSettings::EChannelsMono;

    iConverter->OpenL(tempstr,
    &iClip,
    &iFormat,
    &iSl16Codec,
    &iSettings);



    Any help will be greatly appreciated.

    Thanks in Advance,

    Sanket Lopez.

  2. #2
    Registered User
    Join Date
    Feb 2004
    Posts
    16

    Still looking for help on this one

    Hi,

    I have been trying to solve this problem, when I went through threads in forum, I found that the OpenL() with eight arguments have been documented incorrectly in Documentation and the order last 4 parameters is wrong.

    After using and adapting to the correct version of the eight argument OpenL function I have started getting this new error in MoscoStateChangeEvent(). Its Error -15, this is KErrServerTerminated.

    I dont know why is this happening. I have tried shuffeling all codecs and the Settings But still the error Lives.

    I am really looking some to reach that hand of help and get me out of this one.

    I have also change the way I pass the HBufC descriptor to the OpenL function.

    Bellow is my code snippet.

    Code:
    ==============================================
    TMdaAudioDataSettings iSrcSettings;
    TMdaAudioDataSettings iDesSettings;

    iConverter = CMdaAudioConvertUtility::NewL(*this,NULL,EMdaPriorityMax);

    iSoundBuf = HBufC8::NewL(50000);

    iMyPtr.Set(const_cast<TUint8*>(iSoundBuf->Ptr()), 50000, 50000);

    iDesClipLocation = TMdaDesClipLocation(iMyPtr);
    iSrcClipLocation = TMdaFileClipLocation(tempstr);

    iSrcFormat = TMdaWavClipFormat();
    iSrcCodec = TMdaImaAdpcmWavCodec();
    iSrcSettings.iSampleRate = TMdaAudioDataSettings::ESampleRate16000Hz;
    iSrcSettings.iChannels = TMdaAudioDataSettings::EChannelsMono;


    iDesFormat = TMdaRawAudioClipFormat();
    iDesCodec = TMdaUB16RawAudioCodec();
    iDesSettings.iSampleRate = TMdaAudioDataSettings::ESampleRate8000Hz;
    iDesSettings.iChannels = TMdaAudioDataSettings::EChannelsMono;

    iConverter->OpenL(&iSrcClipLocation,
    &iDesClipLocation,
    &iSrcFormat,
    &iDesFormat,
    &iSrcCodec,
    &iSrcSettings,
    &iDesCodec,
    &iDesSettings);
    ==============================================
    Can some share their experience on this with me.

    Thanks for the Attention.

    Sanket Lopez

  3. #3
    Registered User
    Join Date
    Feb 2004
    Posts
    16

    Please Help

    A Particular thread say that someone has solved this problem, When converting Raw to Wav.

    Any clues will surely help as well.

  4. #4
    Registered User
    Join Date
    Feb 2004
    Posts
    16

    Please help

    I am working on this for more that one week now. Nokia Forum Experts Plz Help

  5. #5
    Registered User
    Join Date
    Feb 2004
    Posts
    16

    Getting KErrNotReady now

    Hi

    I have changed the OpenL Function and instead of passing 8 arguments i pass only 4 arguments.

    Code:
    iConverter->OpenL(&iSrcClipLocation,
                         &iDesClipLocation,
                         &iSrcFormat,
                         &iDesFormat);
    Now in the MoscoStateChangeEvent i get an KErrNotReady. I cant figure out whats happeinng, why is this error thrown.

    Code:
    if (aPreviousState == CMdaAudioConvertUtility::ENotReady && 
              aCurrentState == CMdaAudioConvertUtility::EOpen){ 
             iState = EConvert; 
             TRAPD(err, iConverter->RecordL()); 
             if (KErrNone != err){ // err = KErrNotReady here
                iConverter->Stop(); 
                iConverter->Close(); 
                return; 
             }
    Plz Help.
    Last edited by sanket_lopez; 2004-07-05 at 13:03.

  6. #6
    Registered User
    Join Date
    Feb 2004
    Posts
    16

    Nokia Experts Please Help

    Hi,

    I have Change the OpenL() function to following

    Code:
    iSrcFormat  = TMdaWavClipFormat(); 
    iConverter->OpenL(KSrcFileStream,
                         &iDesClipLocation1,
                         &iSrcFormat);
    the Converters State is changed tp EOpen but then if I try to call a PlayL() or RecordL on it i get a KErrNotReady Error.

    Code:
    if (iConverter == aObject){ 
          if (aPreviousState == CMdaAudioConvertUtility::ENotReady && 
              aCurrentState == CMdaAudioConvertUtility::EOpen){ 
             iState = EConvert; 
    
             TRAPD(err, iConverter->RecordL()); 
             if (KErrNone != err){ 
                TBuf<64> temp;
                temp.Num(err);
                iEikonEnv->InfoWinL(_L("Error"), temp);
                iConverter->Stop(); 
                iConverter->Close(); 
             } 
          } 
       }
    Some One plz Help

  7. #7
    Registered User
    Join Date
    Feb 2004
    Posts
    16

    Help! Help!

    Hasent anybody tried it yet.

  8. #8
    Registered User
    Join Date
    Feb 2004
    Posts
    16

    Forum Experts

    Are u looking into this matter. Plz help. Atleast let me know is this possible.

Posting Permissions

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