Hi...
I want to convert PCM sound file to AMR ,i have gon through board but didn't get the right approach
Help Appericated
Thankx
Sieera01
Hi...
I want to convert PCM sound file to AMR ,i have gon through board but didn't get the right approach
Help Appericated
Thankx
Sieera01
The Symbian MMF (Multimedia Framework) supportes audio conversion from PCM to AMR.
You should use the AudioConvertUtility. You can find more information in:
http://www.symbian.com/developer/tec...lityclass.html
For input - use a TMdaDesClipLocation (it's marked as deprecated in the sdk). You can drop your PCM data into this
for output - use the FourC's stuff (KMMFFourCCCodeAMRND=0x524d4120, KUidFormatAMRWrite=0x101FAF66, KAudioControllerUid=0x101FAF61 ) to set the file type - and a TMdaFileClipLocation for the output file.
Then - you just need to fill in MoscoStateChangeEvent (just like playing back any streaming audio)
Last edited by antogarforum; 2005-12-02 at 12:34.
Hi..
Thankx for reply
but
How to fake a RIFF WAV header on the top of it (i.e. the first 44 bytes have to be "RIFF....WAVEfmt .... etc". )
also can u tell me what header file is having the controller
KAudioControllerUid
.
Regards.
Sieera01
One document that could help you is this one on Multimedia Framework (MMF)in Series 60 where it shows the MMF Audio Utility Classes including the Audio Converter Utility and how to use the constructions and classes you have to derive from:
http://ncsp.forum.nokia.com/download/?asset_id=11732
while running this code it shows me the error code -5
whats wrong with this .
also it it mandatory that both pcm and amr file should exist first.
LIT(KConvertFilepcm,"c:\\sbr.pcm");
_LIT(KConvertFileAmr,"c:\\xyz.amr");
TBuf<4906> filename1;
TBuf<4096> filename2;
filename1 = KConvertFilepcm;
filename2 = KConvertFileAmr;
TMdaFileClipLocation theLocation(filename2);
TMdaClipFormat iFormat = TMdaRawAudioClipFormat();
TMdaAudioDataSettings settings;
settings.Query();
settings.iSampleRate = 8000;
settings.iChannels = 1;
settings.iVolume = settings.iMaxVolume;
TRAPD( err,iAudioConverter->OpenL(filename1,
&theLocation,
&iFormat,
&TMdaSL16RawAudioCodec(),
&settings) );
// TMdaFileClipLocationiSourceFile;TMdaFileClipLocationiTargetFile;
// TMdaFileClipLocation theloc1(filename1);
// TMdaFileClipLocation theloc2(filename2);
/* iAudioConverter->OpenL(&theloc1,
&theloc2,KAudioControllerUid,KUidFormatAMRWrite
,KMMFFourCCCodeAMRNB);*/
if(iAudioConverter->State()==CMdaAudioConvertUtility::EOpen)
{
iAudioConverter->ConvertL();
}