×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50

    Encoding WAV PCM file or data

    I have memory buffer full of audio data in 16 bit PCM format. I can write this to WAV file and everything OK, but naturally the file is very big.

    What is the preferred solution in S60 v3.x for encoding this raw sample data to some common audio file format (e.g. MP4 AAC)? I didnt find any easy way doing this kind of stuff. CMdaAudioConvertUtility seems to be deprecated (?), and CMMFCodec seems only to handle the raw data conversion but not the file format side. Is there some other API for writing converted data to files?

    Alternatively, is there any easy way to convert WAV file to e.g. MP4 AAC file?

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Encoding WAV PCM file or data

    Hi,

    Where does the data come from? The best solution is usually to record in the compressed format in the first place, although that isn't always possible, depending on what you're doing.

    Encoding via CMMFCodec is the tricky part, writing a header for the file format is usually pretty easy.

    I don't think the converter utility is officially deprecated, you'll probably just find that it doesn't work for many formats.

    Another possibility is using RMMFController - you'd have to experiment to see what works but it's just possible that you can add a file rather than the audio input as a source for "recording".

    Sorcery

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50

    Re: Encoding WAV PCM file or data

    The audio sample data is generated by my own application so I just have it in my memory buffer.

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50

    Re: Encoding WAV PCM file or data

    Whee.. \o/ I just managed to do it (just before my head exploded).

    I converted the sample data using CMMFCodec::NewL(KMMFFourCCCodePCM16, KMMFFourCCCodeAAC) and just wrote the destination buffer to file. The key was to use streamable ADTS format for the AAC data and any file format headers were not needed. Just name the output file as filename.aac and it's playable.

Similar Threads

  1. Problem with GCCE build in Carbide.vs
    By raffaelbechara in forum Symbian C++
    Replies: 6
    Last Post: 2008-10-20, 16:06
  2. The error of read data from file
    By balloon22607 in forum Symbian C++
    Replies: 1
    Last Post: 2007-04-02, 12:25
  3. Replies: 0
    Last Post: 2006-06-05, 18:08
  4. Replies: 1
    Last Post: 2005-05-26, 14:22
  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
  •