Help with CAmrToPcmDecoder

Login to reply to this topic.
Wed, 2003-12-17 18:57
Joined: 2003-11-03
Forum posts: 3
Hi!

I´m trying to use the "CAmrToPcmDecoder" class to convert an AMR stream into a PCM stream, for a audio streaming solution I am implementing.

I read the amr, skip the first 6 bytes of the header. The data seems to be ok ( a call to FrameInfo returns data that seems to be ok in the TAmrFrameInfo parameter ). But...

When I call the CAmrToPcmDecoder::Decode funtion, although the return value is 0 ( so, no error then?) , the aSrcUsed parameter ( the 2nd one ), returns with 0 or 1 , and the aDstLen with 320.

The source pointer is more that 1KB ( in one test , it was almost 5 ), and the destbuffer, up to 50KB, so I guess it should have enough room for the data.

 Any help ? I´m getting a bit desperate, specially for the HUGE lack of documentation in this matter.


Thanks a lot in advance,


   londo

PS: eric, thank A LOT for your web page, it is really brilliant!

--------------------------------------------------
"You will be assimilated.Resistance is futile"


Thu, 2003-12-18 13:31
funka (not verified)
Forum posts: 2043
You'are alone ...
yes yes ! I understant what you want ! But ! You know i 'm french and my mother comes from marrocco and my father come from guadeloupe so it's difficult for me today to find a friend like you... Yes i know you are alone i know you need love in this deep shit ! because i agree with and my collocataire too : that's a big shit man ! So if you have any questions because we are engineer in social engeering controling yourlself baby mail me at funka@yourcrazyU.net
Mon, 2004-01-05 06:37
Joined: 2003-10-14
Forum posts: 14
Help with CAmrToPcmDecoder
hi,

I am also trying to use CAmrToPcmDecoder to decode from voice from AMR to PCM format. But I am not able to hear anything after decoding the voice. There is also no proper documentation on this. Could anyone please help.

Thanks in advance,
Karen
Tue, 2004-01-06 09:14
Anonymous (not verified)
Forum posts: 2043
Help with CAmrToPcmDecoder
Code:
// PCM to AMR encoding example
// Use at own risk etc
// This API isn't well documented - I might have made a mistake in typing the below,
// made a mistake in working out what the parameters should have been or be barking
// up the wrong tree entirely.  If your house falls down because of using this code
// don't blame me!  However, I have had similar code working - so I think you should
// be okay ;)

// Need to link with amrdll.lib BTW
#include <amrcodec.h>

// PCM data (has to be 8000Hz, 16 Bit, mono)
byte *inputBuffer=blah;
// Length of data in input buffer
int inputBufferSize;

// Output buffer (AMR encoded)
byte *dest=User::Alloc(blah);
// Length of data written to output buffer
int outputBufferSize;
// Encoding parameters ...
TAmrEncParams encodeParams;
// Use defaults otherwise set the values below
// encodeParams.iMode=
// encodeParams.iDTX=

// Construct the encoder
CPcmToAmrEncoder *encoder=CPcmToAmrEncoder::NewL(encodeParams);

// Reset it (just in case we need to) - it not using default TAmrEncParams then
Reset(encodeParams)
encoder->Reset();

int inputUsed;
int outputUsed;
int inputOffset=0;
int outputOffset=0;
while(inputBufferSize>0) {
       inputUsed=inputBufferSize;
       outputUsed=outputBufferSize;
       encoder->Encoder(inputBuffer+inputOffset,inputUsed,outputBuffer+outputOf
fset,outputUsed);
       inputOffset+=inputUsed;
       outputOffset+=outputUsed;
       inputBufferSize-=inputUsed;
       outputBufferSize-=outputUsed;
}



And the header for the file I was talking about before - it should be #!AMR\n (any unix hackers out there will now go "hey - cool". For non unix people out there - these menas that if your AMR playing program is in your path and called AMR then you can execute a AMR file and it will be automatically loaded into your player and played). The header for wide band AMR is #!AMR-WB\n
Mon, 2004-02-09 17:41
Joined: 2003-11-03
Forum posts: 3
p800?
I got it working, but i have another question.

I was looking for the amrcodec.h header on the uiq2.1 sdk, but it does not appear. Is it that it only works on series60 sdk or that the header was never supposed to be there in the s60 in the first place ?

So, s it possible, somehow, to have access to that class with uiq?

Help, please?

 londo

--------------------------------------------------
"You will be assimilated.Resistance is futile"

Mon, 2004-02-09 18:03
Anonymous (not verified)
Forum posts: 2043
Help with CAmrToPcmDecoder
Well - you *should* really being using the MMF (MultiMedia Framework) to do this (look at the CAudioConverter class)

However - I don't think it supported AMR in symbian 6.X - so Nokia put amrdll.dll in with series60.  This is what you are currently using.  This is available on 7650, 3650 and N-Gage.

Symbian 7, Series60v2 phones (like the Nokia 6600) don't have it - but they do have additional codecs in the MMF to support AMR

UIQv2.0 is Symbian 7 based - so you need to look at the MMF.  Once you work out what's going on - it's not *that* much of a bloated waste of resources.
Wed, 2004-10-06 18:00
Joined: 2004-02-04
Forum posts: 26
Help with CAmrToPcmDecoder
Quote
Symbian 7, Series60v2 phones (like the Nokia 6600) don't have it - but they do have additional codecs in the MMF to support AMR

I need to do PCM -> AMR converting and I use the Series60v2.
Does anyone know which classes I should use?
I found some examples on this forum but they use some classes that doesn't exist in Series60v2.

Thanks in advance,
Sasa

It is always nice to help out people that need help.
http://www.vegaitsourcing.rs
http://www.codeplex.com/aspnetlibrary

Wed, 2004-10-06 20:47
Joined: 2004-09-27
Forum posts: 2
Help with CAmrToPcmDecoder
I am in the same boat, but I am trying to convert from AMR to PCM using the 6600 with v2 (MMF). I need to convert the audio frames individually because I am receiving the data from a stream, so I can't use the CMdaAudioConvertUtility class. I am trying to use the CAmrToPcm class from v1.2 (I am just linking against the old lib basically), but I am still fighting with it and I don't know if it's going to work.

Any help will be greatly appreciated. Whenever I figure this out I am going to post it here because *way too many people* seem to have gone through this, with very little help from the Nokia folks. I can't believe they don't have someone in here helping more. Pretty frustrating.

Thanks,

Edison Thomaz
Tue, 2004-12-07 00:52
Joined: 2004-10-15
Forum posts: 10
Help with CAmrToPcmDecoder
Hi Edison, there are really some waiting for you  Sad
  • Login to reply to this topic.