×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    27

    CMdaAudioRecorderUtility - last second cut off

    Hi - I'm using CMdaAudioRecorderUtility on a 6600 to record a phone call.

    I basically start recording when the call begins and want to record up until the end of the call.

    Here's the start of the problem: CMdaAudioRecorderUtility crops the last second when you stop recording. (I thought I saw this on a "Known Issues" list, though I can't find it now). Anyway, the solution should be to record for one more second after the call finishes...

    Here's the real problem - when the call ends, the CMdaAudioRecorderUtility stops recording - it calls back to MoscoStateChangeEvent with an error "-13" which means KErrDied. I don't get the chance to continue recording for an extra second, even if I want to.

    So - all my recorded phone calls have about a second cut off the end.

    Does anyone have a solution to this problem? Any method of attack would be good - either a fix for the cropping or a fix for the dying when the call ends (or anything else you can think of)

    Thanks

    Kibi

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    27
    Replying to my own post!

    It turns out that pretty much the entire phone conversation is correctly caught in the recorded WAV file - however, the built in 6600 Voice Recorder application does not play the file correctly - when I sent the file to my PC I could hear the last second which was previously "Cut off"!

    So why doesn't the sound get played? I found 2 reasons:
    Looking inside the WAV file which had been created, the length of the data chunk was incorrectly short - it seems most Windows players don't care what the data length is officially and play to the end (probably because they are "protecting" against buffer overwrite hacks, so they simply don't worry what the stated length is). The Symbian player might possibly be more strict, so I adjusted the file (after recording) to have this length correct.

    This step helped a bit, but not completely - I could still hear more on my PC than my phone from the same file....so I then adjusted the file adding another second of blank sound on the end of the file (also adjusting the file data length and data chunk length in the file). This gives me the full amount of sound info playing on the phone that I had on the PC.

    Still, it's a ridiculous hack, and I wonder when Nokia/Symbian will get around to fixing the sound player utility.

    Also, if anyone has information about recording *past* the end of the call (I'm still losing maybe half a second of conversation, and while that half second is normally "Goodb..." it still sounds a little awkward) it would be great to hear it.

    thanks

    Kibi

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    35
    Hi Kibi,

    Did you record the call to a file or to des?
    How did you workaround the panic when using CropL() function
    Which codec did you use?

    Thanks
    Eran

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    27
    Hi Eran

    I am recording directly to a file. I have a very plain "template" WAV file (60 bytes long) which I copy with a new name and then open to start recording. This way the recorder keeps recording in WAV format without any need for fancy code..

    I don't actually call the CropL function - my sound sample is too cropped as it is - I need to make it longer, not shorter! When I mentioned "Cropping" I meant the recorder somehow cuts off the end of the message (without me calling CropL).

    At this point in ther program I'm not really touching codecs - by copying and opening a file of type WAV I short-circuit the process and force the recorder to use WAV (I guess it forces use of the PCM Codec, if that makes sense).

    My new problem is to convert the PCM WAV file into AMR format. The S60 v2 documentation has a class CPcmToAmrEncoder, so I wasted a day trying that before seeing a release note which said that it was deprecated....with no note as to what alternative to use.

    Don't'cha love Nokia/Symbian?

    Kibi

  5. #5
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    52

    recording?

    Hi kibi,

  6. #6
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    52

    recording?

    Hi kibi,

  7. #7
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    52

    Recording?

    Hi Kibi,
    I am also trying to record the voice data of an incoming call and I do not want the voice data to reach the speaker as well while I am recording. Can you give me a code snippet that will help me to do this. Can you give inputs about how to record voice data from an incoming call. Thank you in advance.

  8. #8
    Registered User
    Join Date
    Mar 2003
    Posts
    27
    Hi Sakhya

    I do not know a way to stop the sound reaching the speaker. You might dig around in the Symbian/Nokia files and find a function which mutes the incoming phone signal, but my guess is that this would also stop it being recorded properly.

    Supposedly there are some unpublished Nokia/Symbian APIs which can allow you to change the volume setting on your phone, effectively preventing anything coming out of the speaker. I think you have to be in bed with Nokia before you can get hold of those APIs.

    As for recording from a phone call, I have a very small WAV file (basically bit-sculpted down to a simple header with datalength = 0). I use functions from BaflUtils to copy this template file to the name of my new message, thern I open a CMdaAudioRecorderUtility object on that file:

    iMdaAudioRecorderUtility->OpenFileL(iNewFileName);

    This avoids all the need for figuring out clever settings like the bitrate etc.

    When the call starts I call this code:

    // Set maximum gain for recording
    iMdaAudioRecorderUtility->SetGain(iMdaAudioRecorderUtility->MaxGain());

    iMdaAudioRecorderUtility->SetPosition(TTimeIntervalMicroSeconds(0));

    iMdaAudioRecorderUtility->RecordL();

    then when it's finished I call

    iMdaAudioRecorderUtility->Stop();

    iMdaAudioRecorderUtility->Close();

    Then I call my code for adding a blank second (I'll post this if you want - but you can find it here too:
    http://forum.newlc.com/viewtopic.php?t=3862)

    Good luck

    Kibi

  9. #9
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    52
    Thank You Kibi, for answering so early, but I am still not able to do it.
    I am not getting the recorded voice from the incoming call, instead I am getting it from the mic. here is my code.

    CRecorderAdapterublic MMdaObjectStateChangeObserver
    void CRecorderAdapter::ConstructL()
    {
    iMdaAudioRecorderUtility = CMdaAudioRecorderUtility::NewL(*this);
    iMdaAudioRecorderUtility->OpenFileL(KRecorderFile);
    }
    void CRecorderAdapter::RecordL()
    {
    // Record from the device phone
    iMdaAudioRecorderUtility->SetAudioDeviceMode(CMdaAudioRecorderUtility::ETelephonyNonMixed);

    iMdaAudioRecorderUtility->SetGain(iMdaAudioRecorderUtility->MaxGain());

    iMdaAudioRecorderUtility->SetPosition(TTimeIntervalMicroSeconds(0));
    /iMdaAudioRecorderUtility->CropL();

    iMdaAudioRecorderUtility->RecordL();
    }
    void CRecorderAdapter::StopL()
    {
    iMdaAudioRecorderUtility->Stop();
    iMdaAudioRecorderUtility->Close();
    }

  10. #10
    Registered User
    Join Date
    Jul 2003
    Posts
    24

    Share your code ?

    Hi,
    I'm new to Symbian and would also like to write an app that records an audio conversation to a file. Would you be kind enough to share your code? Your approach seems simpler than others and may be easier for me to understand.

    If not, can you point me to any example code for audio recording?

    Thanks
    Yusuf

  11. #11
    Registered User
    Join Date
    Apr 2005
    Location
    Pune
    Posts
    115

    Re: CMdaAudioRecorderUtility - last second cut off

    Hi,
    I am also facing the same problem. When i record to a wav file using CMdaAudioRecorderUtility and playback it cuts off the last second data.
    However, if i listen it on my PC it plays fully.

    Please Suggest. Thanx in advance

    Cheers,
    Shivam

  12. #12
    Registered User
    Join Date
    Jul 2003
    Posts
    24

    Re: CMdaAudioRecorderUtility - last second cut off

    Hi,

    It's been a while, but I seem to remember solving the problem using CMdaAudioInputStream instead of the recorder utility. The buffering helped the playback.

    Hope it helps,
    Y

  13. #13
    Registered User
    Join Date
    Mar 2003
    Posts
    27

    Re: CMdaAudioRecorderUtility - last second cut off

    Hi Shivam
    If you read all my replies above (and follow my link to NewLC) you will see my colution - if there is something unclear, I am happy to help

    Kibi

Posting Permissions

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