Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2006

    Thumbs down No output using CMdaAudioOutputStream with SetDataTypeL to play MP3


    I am trying to play mp3 audio from memory using CMdaAudioOutputStream according to the last sections (#5 and #6) in "S60 Platform: Music Application Developer's Guide".

    The application is developed with SDK 2nd ED FP2 and tested on target platform - Nokia 6630 (8.0a 2nd ED FP2).

    Audio & Video
    Nokia 6630 Spec

    When tested on the 6630, there is simply no output at all. The general program flow is:

    In ConstructL():
    iStream = CMdaAudioOutputStream::NewL(*this)

    In MaoscOpenComplete(TInt aError): (aError = 0 in the log)
    iStream->SetAudioPropertiesL(TMdaAudioDataSettings::ESampleRate32000Hz, TMdaAudioDataSettings::EChannelsMono);

    *32kHz Mono IS the property of the loaded MP3 audio.

    In a user triggered event:
    TRAPD(t, iStream->WriteL(iAudioDataPtr));

    *MP3 data loading is verified. The trapped value t here is 0 in the log.

    Shortly after, MaoscBufferCopied(TInt aError, const TDesC8& aBuffer) is called with aError = 0. There is no sound and MaoscPlayComplete(TInt aError) never gets called.

    Is Nokia 6630 able to use SetDataTypeL() to play anything other than PCM16 data? If I remove SetDataTypeL() I DO hear garbage, as MP3 data are intepreted as PCM16.

    I have also tried with CMdaAudioPlayerUtility::OpenDesL(). According to the guide mentioned earlier it requires a MIME type inserted before MP3 data. I tried inserting a standard ASCII string "audio/mpeg", "audio/mpeg\r\n\r\n", "audio/x-mp3" ... and never had any luck. Am I using the wrong format or should I use 16-bit Unicode for that?

    Thanks for your help.

    There are a few interesting points I discovered:
    1. When using CMdaAudioPlayerUtility::OpenFileL(), the MP3 file plays fine for sure.
    2. The 2nd ED FP2 SDK document NEVER mentions anything about CMdaAudioOutputStream::SetDataTypeL(), but checking with mdaaudiosampleplayer.h, it IS there.

    Best Regards,
    Kevin Peng

  2. #2
    Regular Contributor
    Join Date
    Sep 2006

    Re: No output using CMdaAudioOutputStream with SetDataTypeL to play MP3


    im able to play mp3 file in S60 3rd edition.
    my settings are
    CMdaAudioOutputStream* iPlayer;
    TMdaAudioDataSettings iSettings;

    iSettings.iSampleRate = TMdaAudioDataSettings::ESampleRate44100Hz;
    iSettings.iChannels = TMdaAudioDataSettings::EChannelsStereo;
    iPlayer->SetPriority(EMdaPriorityMax, EMdaPriorityPreferenceQuality);

    im loading 44khz stereo mp3 file
    im using buffer size of 4096


Similar Threads

  1. Recording in Amr Format
    By losym in forum Symbian Media (Closed)
    Replies: 12
    Last Post: 2009-03-26, 06:41
  2. CMdaAudioOutputStream to play AAC+
    By sameet in forum Symbian Media (Closed)
    Replies: 6
    Last Post: 2006-12-04, 06:15
  3. Cannot play MP3 with chinese filename in MMAPI
    By domicch in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2006-05-17, 07:36
  4. Nokia 6630 play dynamically generated MP3
    By chinchihfang in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-12-01, 10:25
  5. how to play mp3 file?
    By zwgoal in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2005-11-14, 08:21

Posting Permissions

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