×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    when use Aac codec, how detect CMdaAudioOutputStream::SetAudioPropertiesL param?

    hi everyone, I have a question, when follow this link, I can decode aac stream to pcm data. but I don't known how get the pcm data's sample rate.

    anybody can tell me how get the param?

    example 1, I have a 1.aac file, use this code get source sample rate is 44100, 1 channel, when use pc music player, I find the param is 44100hz, stereo, 16bit, but when use CMdaAudioOutputStream::SetAudioPropertiesL, I found only set ESampleRate11025Hz, it will work correct.

    but the other music file, 2.aac, use same way, i get param 16000, 2 channels, use pc music palyer, the param 32000 hz, stereo, i found set ESampleRate16000Hz, it work correct.

    all the config param is same,

    RArray<TInt> configParams;
    > configParams.Append(16000);
    > configParams.Append(1);
    > configParams.Append(1);
    > configParams.Append(1024);
    > configParams.Append(0);
    > configParams.Append(0);
    > configParams.Append(0);
    > configParams.Append(0);
    > configParams.Append(16);
    > configParams.Append(0);
    > iCodec = CMMFCodec::NewL(TUid::Uid(0x101faf81));
    > iCodec->ConfigureL(TUid::Uid(KUidMmfCodecAudioSettings),
    > (TDesC8&)configParams);
    > configParams.Close();

    it seems configrarams not define the output param, it seems limit by aac type, why?
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

  2. #2
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: when use Aac codec, how detect CMdaAudioOutputStream::SetAudioPropertiesL param?

    can anyone help me? welcome any help, thanks.
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

  3. #3
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: when use Aac codec, how detect CMdaAudioOutputStream::SetAudioPropertiesL param?

    when I use eaac+ codec, config output param, it seems not useful. for 1.aac, it still is ESampleRate11025Hz, not I want ESampleRate16000Hz, why ?

    configParams.Append(iSampleRate);
    configParams.Append(iChannel);
    configParams.Append(1);
    configParams.Append(4096);
    configParams.Append(1024);
    configParams.Append(iSampleRate);
    configParams.Append(0);
    configParams.Append(0);
    configParams.Append(16);
    configParams.Append(16000);
    configParams.Append(0);
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

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

    Re: when use Aac codec, how detect CMdaAudioOutputStream::SetAudioPropertiesL param?

    Hi,

    In the first case, you are setting the input sample rate incorrectly for the first file:
    Code:
    RArray<TInt> configParams;
    > configParams.Append(16000);
    > configParams.Append(1);
    > configParams.Append(1);
    > configParams.Append(1024);
    > configParams.Append(0);
    > configParams.Append(0);
    > configParams.Append(0);
    > configParams.Append(0);
    > configParams.Append(16);
    > configParams.Append(0);
    > iCodec = CMMFCodec::NewL(TUid::Uid(0x101faf81));
    > iCodec->ConfigureL(TUid::Uid(KUidMmfCodecAudioSettings),
    > (TDesC8&)configParams);
    > configParams.Close();
    The last item is for sample rate conversion, should be 0 for no extra SRC, 8000 fixed or 16000 fixed.
    If you don't have the correct input sample rate set though, this may affect the output.

    eAac+ is a bit more complicated and I can't claim to be an expert. Have you tried checking what happens when you switch on the downsampled mode?

    configParams.Append(iSampleRate);
    configParams.Append(iChannel);
    configParams.Append(1);
    configParams.Append(4096);
    configParams.Append(1024);
    configParams.Append(iSampleRate);
    configParams.Append(0);
    configParams.Append(0); //change this to 1?
    configParams.Append(16);
    configParams.Append(16000);
    configParams.Append(0);

    Sorcery

  5. #5
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: when use Aac codec, how detect CMdaAudioOutputStream::SetAudioPropertiesL param?

    thanks Sorcery-ltd.
    on 1st case, I have tried use
    configParams.Append(44100); // both try 44100 and 16000
    configParams.Append(1); // both try 1 and 2
    but it seems no change.

    and I'll try change downsampled param, thanks.
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

  6. #6
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: when use Aac codec, how detect CMdaAudioOutputStream::SetAudioPropertiesL param?

    hi Sorcery-ltd.
    I have try change downsampled param, but it seems no effect.
    or it is the aac audio problem?
    the music is 1.aac, can you explain the audio strange reason?
    thanks.
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

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

    Re: when use Aac codec, how detect CMdaAudioOutputStream::SetAudioPropertiesL param?

    Hi,

    According to QuickTime (which I find is usually the most accurate at discovering these things) this file is 22,050 mono, not 44,100. Perhaps that is the problem. Or possibly there is something wrong with the file and the decoder doesn't like it, so it uses some defaults for the decoding?

    Sorcery

  8. #8
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: when use Aac codec, how detect CMdaAudioOutputStream::SetAudioPropertiesL param?

    thanks Sorcery-ltd.
    and How can known the audio is mono or stereo?
    did the value is equals channel number(get by code)? 1 for mono, 2 for stereo?
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

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

    Re: when use Aac codec, how detect CMdaAudioOutputStream::SetAudioPropertiesL param?

    Yes, it should be 1 channel for mono, and 2 for stereo.

    Depending on what level of abstraction you're looking at though, there are other things like joint stereo. Also, some layers of software (though not exposed to the public I think...) have a stereo flag, where 1 equals stereo and 0 equals mono... it's very confusing stuff.

    I hope you get it working. Often, the easiest thing to do if you have control of the audio files (i.e. they are included in your application install) is to re-encode them with a known format and parameters of your own. eAAC+ in particular is very complex with lots of different encoding methods/parts/paramters/options.

    Mark

  10. #10
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: when use Aac codec, how detect CMdaAudioOutputStream::SetAudioPropertiesL param?

    thanks Sorcery-ltd, thank your reply
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

Similar Threads

  1. Using AAC codec in Nokia 6630
    By fastsymbian in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2006-06-05, 20:54
  2. Using AAC codec in Nokia 6630
    By fastsymbian in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2006-06-05, 20:52
  3. aac codec for 6600????
    By westlife2310 in forum Streaming and Video
    Replies: 1
    Last Post: 2006-01-25, 00:06
  4. aac codec for 6600
    By westlife2310 in forum Mobile Java General
    Replies: 0
    Last Post: 2006-01-23, 15:26
  5. OMA Client Provisioning, ISDN-config
    By breber2 in forum Smart Messaging
    Replies: 1
    Last Post: 2004-04-26, 11:32

Posting Permissions

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