×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    25

    Post Converting PCM to Amr sound file..

    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

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    23

    Re: Converting PCM to Amr sound file..

    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.

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    25

    Re: Converting PCM to Amr sound file..

    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

  4. #4
    Registered User
    Join Date
    Sep 2004
    Posts
    23

    Re: Converting PCM to Amr sound file..

    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

  5. #5
    Registered User
    Join Date
    Apr 2005
    Posts
    25

    Re: Converting PCM to Amr sound file..

    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();

    }

Similar Threads

  1. Converting from AMR to PCM16 does not work!!!
    By khurshed79 in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2005-12-15, 05:39
  2. Sample code for playing AMR file.
    By khurshed79 in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-07-27, 12:36
  3. Replies: 1
    Last Post: 2005-05-26, 14:22
  4. PCM to AMR encoder
    By kavijohn in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2005-02-17, 06:47
  5. Replies: 0
    Last Post: 2002-06-10, 12:24

Posting Permissions

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