×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    64

    use CMdaAudioOutputStream to play audio data and get a exception

    hi:
    everyone! i want to use the CMdaAudioOutputStream to play audio data,but when i call the WriteL method the
    system throw a exception.who know why? some advice will be welcome! following is part of my code:
    Code:
      TPtr16 ptr16 = TPtr16(a_buf,2048);
      iMp3DecoderEngine->DecodeOneFrame(ptr16);
      TInt length1 = ptr16.Length();
      TPtrC8 ptr8;
      ptr8.Set((TUint8*)buf,4096);
      TInt length = ptr8.Length();
      iAudioOutputStream->WriteL(ptr8);
    thank you in advance!

    daiqingping

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: use CMdaAudioOutputStream to play audio data and get a exception

    Might help, if you could tell what the panic code is.

  3. #3
    Registered User
    Join Date
    Aug 2008
    Posts
    64

    Re: use CMdaAudioOutputStream to play audio data and get a exception

    thank you for your replying! i didn't get a panic code,it just says that there is a unhandle exception: user interrupt. the IDE is vs 2003.

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

    Re: use CMdaAudioOutputStream to play audio data and get a exception

    At what line does this occur? Anyway my guess is your TPtrC8 runs out of scope and causes the fault. Try making the ptr that you hand over to WriteL() a class member of the encapsulating class.

    - Matti
    --
    Matti Dahlbom
    http://irssibot.777-team.org/

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: use CMdaAudioOutputStream to play audio data and get a exception

    have you checked Wiki for getting the actual Panic code: http://wiki.forum.nokia.com/index.ph...ded_panic_code

  6. #6
    Registered User
    Join Date
    Aug 2008
    Posts
    64

    Re: use CMdaAudioOutputStream to play audio data and get a exception

    thank you for your replying! the problem is solved. I should make the ptr that hand over to WriteL method as a member of a encapsulating class as k4l4 said. thank you again!


    daiqingping

  7. #7
    Registered User
    Join Date
    Aug 2008
    Posts
    64

    Re: use CMdaAudioOutputStream to play audio data and get a exception

    hi:
    everyone! i can use the CMdaAudioOutputStream to play wav file.but that just in the case of single channel.
    i need some advice about how to set the buffer when i want play a dual channel audio file use this class. thank you in advance!

    daiqinping

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: use CMdaAudioOutputStream to play audio data and get a exception

    What have you tried so far? Apparently there are possibilities for setting such details in CMdaAudioOutputStream::SetAudioPropertiesL, and in the TMdaPackage you are passing to CMdaAudioOutputStream::Open.

  9. #9
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: use CMdaAudioOutputStream to play audio data and get a exception

    And regarding the buffer, just use the usual interleaved setup: L R L R channels..

  10. #10
    Registered User
    Join Date
    Aug 2008
    Posts
    64

    Re: use CMdaAudioOutputStream to play audio data and get a exception

    thank you! i get it.

Posting Permissions

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