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)
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.
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.
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.
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:
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?
Re: CMdaAudioRecorderUtility - last second cut off