Symbian OS
read last symbian news on www.newlc.com read last symbian reviews on www.newlc.com
read last symbian tutorial on www.newlc.com read last symbian download on www.newlc.com
31 May 2007 - 17:09
Keywords :

For me, develop applications for Symbian was always like ideas->SDK helper->forums->R&D->forums->R&D->...->implementation. This time I thought the problem would be easier, but it did not.

I tried to port Nokia's audio streaming example to UIQ3. Since the code for S60 was already done and there's another output streaming example in sonyericsson website, it couldn't be easier, right? Well, we'll see.

When I copied the S60 code to UIQ it compiled as I expected, but it didn't work for me! I can not record any audio. Through a lot of searching I got the answer and listed below, hope can help you when you meet the same problem:

  • You have to set the bit rate to 12200 to get UIQ phones work when recording. Or else you will meet KErrArgument when recording. Refer to attached example code to know more. I think the reason is CMdaAudioInputStream class takes advantage of DevSound and the DevSound relies on hardware (DSP) codecs.
  • From reference #1, you can see on UIQ3 phones, Audio (CMdaAudioXxxx) APIs only support AMR-NB format audio recording. The original text is "The only format currently available for audio recording by third party applications is AMR-NB. Additional formats may be available in future versions."
  • When doing recording, make sure you give the inputstream big enough buffer, or else API will leave with KErrOverflow when recording the last frame.
  • MaiscRecordComplete() callback function may never be called. As the SDK helper, it says "A callback function that is called when the input stream is closed using CMdaAudioInputStream::Stop().", but it's not true. Most of the case, MaiscRecordComplete will not be called when I invoke CMdaAudioInputStream::Stop(). Actually, as far as I know, it is called when recorder met some errors.
  • Don't forget to add the AMR header to the file when you want to save recorded contents. Or it can't be played by any player.

I attached the example code because in developer.sonyericsson.com, there is only an example of outputstream while inputstream is actually more tricky to use.

References

  1. UIQ 3 C++ Developers guidelines
  2. MaiscRecordComplete() issue
  3. Bit rate issue

Example Code

The code is tested in P990i(Organizer:R6D18) and M600i(Organizer:R1A52)

UIQAudioEngine.zip
(or mirror on NewLC).

You can also find this article in my Blog

AttachmentSize
UIQAudioEngine.zip41.76 KB
Tutorial posted May 31st, 2007 by rensijie

Submitted by www.beemobile.se on Tue, 2007-06-05 03:33.

I'm sure there are a couple of people who will save a week or two's of work, by having a look at this article.

I still think you shoul do the one on how to get Bluetooth going on the Emulator using the dongle.

BeeMobile Consulting AB - supplier of flexible, responsible professionals.


Submitted by rensijie on Tue, 2007-06-05 03:41.

Sure, I'll do this. Tell you when I'm done.

Taking you forward.


Submitted by bexp on Thu, 2007-12-20 10:50.

I have -21 KAccessDenied error code on my M600i


Submitted by shravan_vip on Thu, 2008-04-17 07:03.

I have been successful for writing a code for call rejection and playing a audio (wav) file saying"The Network is busy" etc initially I have used autoanswering feature too. The problem is that, the sound(input sound) from reciever is coming out. I want to mute it. please help me.

Shravan


Submitted by lori_c on Fri, 2008-05-09 08:31.

hi,
I have got KErrPermissionDenied in MaoscBufferCopied when I play the auido, Why?



copyright 2003-2009 NewLC SARL