×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    40

    problem while recording in buffers in CmdaAudioInputStream and playing with CmdaAudio

    Hi all,

    I am using the buffer array for recording through CmdaAudioInputStream. I Took the 50 buffers array. I have initialized counting to 0. Now During each read operation counting is incremented to 1. I am taking the buffer size of 11200 bytes. As calls are asynchronous, suddenly the counter reaches its maximum limit and recording is not fine...

    Can any one suggest me the way....

  2. #2
    Registered User
    Join Date
    Nov 2004
    Posts
    42

    Re: problem while recording in buffers in CmdaAudioInputStream and playing with CmdaA

    You must issue the readL() in the maiscbuffercopied callbacks not in a loop.
    So the async process is driven from the MMF timings and needs.
    On every callback process/save the chunk of data (inside the descriptor) you get from the mic and issue a new readL().

    Rocco

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

    Re: problem while recording in buffers in CmdaAudioInputStream and playing with CmdaAudio

    see i am already doing like this. see the code:
    void CHelloWorldBasicAppUi::MaiscOpenComplete(TInt aError)
    {



    pInStream->SetAudioPropertiesL(TMdaAudioDataSettings::ESampleRate8000Hz,TMdaAudioDataSettings::EChannelsMono);

    // set stream properties, 16bit 8KHz mono

    // set stream input gain to maximum
    pInStream->SetGain(pInStream->MaxGain());
    // set stream priority to normal and time sensitive
    pInStream->SetPriority(EPriorityNormal, EMdaPriorityPreferenceTime);
    pInStream->ReadL(*iStreamBuffer[m]);

    }
    void CHelloWorldBasicAppUi::MaiscBufferCopied(TInt aError, const TDesC8& aBuffer)
    {

    if (&aBuffer==iStreamBuffer[iStreamBuffer.Count()-1])
    m=0;
    else
    m++; // issue ReadL() for next audio data block

    if (aError==KErrNone)
    {

    pInStream->ReadL(*iStreamBuffer[m]);

    }
    else
    {
    TBuf16<100> st;
    CAknInformationNote* informationNote1;
    //_LIT(message,"There is error");
    st.AppendNum(aError);
    informationNote1 = new ( ELeave ) CAknInformationNote;
    informationNote1->ExecuteLD(st);
    }

    }

    But when i run this code...recording is fine ...
    and when i press at play....count of m is 50 after 2 seconds....and it is not played well...

    can you please see it where am i wrong?

  4. #4
    Registered User
    Join Date
    Nov 2004
    Posts
    42

    Re: problem while recording in buffers in CmdaAudioInputStream and playing with CmdaA

    do you use the same callback driven method for playing too?
    I mean WriteL() in maoscbuffercopied.
    You might have something wrong in the play part

    Rocco

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

    Re: problem while recording in buffers in CmdaAudioInputStream and playing with CmdaAudio

    In the play part see the code
    void CHelloWorldBasicAppUi::PlayL()
    {

    TInt iFileSize;
    TMdaAudioDataSettings iSettings;
    pInStream->Stop();
    pStream = CMdaAudioOutputStream::NewL(*this);

    pStream->Open(&iSettings);


    }

    void CHelloWorldBasicAppUi::MaoscOpenComplete(TInt aError)
    {

    pStream->SetAudioPropertiesL(TMdaAudioDataSettings::ESampleRate8000Hz,TMdaAudioDataSettings::EChannelsMono);
    pStream->SetVolume(pStream->MaxVolume());
    pStream->WriteL(*iStreamBuffer[n]);



    }

    void CHelloWorldBasicAppUi::MaoscBufferCopied(TInt aError,const TDesC8& aBuffer)
    {
    if (&aBuffer==iStreamBuffer[iStreamBuffer.Count()-1])
    {


    }
    else
    {

    // rotate stream if necessary
    n++;
    if (n==iStreamBuffer.Count()) n=0;
    // issue WriteL() for next audio data block
    pStream->WriteL(*iStreamBuffer[n]);
    }

    CAknInformationNote* informationNote2;
    informationNote2 = new ( ELeave ) CAknInformationNote;
    st.AppendNum(aError);
    informationNote2->ExecuteLD(st);


    }

    Now please tell what is wrong?

  6. #6
    Registered User
    Join Date
    Jan 2006
    Posts
    40

    Re: problem while recording in buffers in CmdaAudioInputStream and playing with CmdaAudio

    Yeah I am through....

  7. #7
    Registered User
    Join Date
    Jan 2006
    Posts
    40

    Re: problem while recording in buffers in CmdaAudioInputStream and playing with CmdaAudio

    yeah i solved it.

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

    Unhappy Re: problem while recording in buffers in CmdaAudioInputStream and playing with CmdaAudio

    iam interested to know the solution
    i dont know anything about symbian, and have a project to deliver
    and what you are doing seems to be very usefull to me if you dont mind...
    i have already submitted my problem in a thread called (problem in CMdaAudioRecorderUtility)
    but no one gave me a hand till now ...
    i'd be grateful if you could tell me what's wrong in my code
    and 2nd i wanna know how to access my recorded file as an array

    i would really really appreciate any help
    Last edited by elhasab; 2006-01-30 at 00:25. Reason: new progress achieved

Similar Threads

  1. Replies: 1
    Last Post: 2006-06-14, 10:47
  2. Sound recording and playing
    By sasa in forum Symbian
    Replies: 0
    Last Post: 2004-10-12, 13:41

Posting Permissions

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