×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    104

    Question about RBuf8

    Hello everyone,

    I have a problem that will probably be trivial to someone with more knowledge about Symbian.

    I need to play an audio stream. I do it like this:

    Code:
    in .h
    CMdaAudioOutputStream* iAudioStream;
    in .cpp (I'm omitting if (err ==...))
    Code:
    TRAP(err, iAudioStream->SetDataTypeL(KMMFFourCCCodePCM16));
    TRAP(err, iAudioStream->SetAudioPropertiesL(TMdaAudioDataSettings::ESampleRate11025Hz, TMdaAudioDataSettings::EChannelsMono));
    TRAP(err, iAudioStream->WriteL(buffer));
    I don't have a problem playing audio if I open a file. But I need to generate audio data on the fly. My problem lies with iAudioStream->WriteL(buffer) because buffer in iAudioStream->WriteL must be RBuf8 and the data that I need to play is located in TFixedArray<TInt16, 512> buffer.

    Could someone please tell me how to go about transfering data from the fixed array to audio stram's RBuf8 buffer?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,672

    Re: Question about RBuf8

    I do not think that it would have to be an RBuf8, it can be any kind of 8-bit descriptor.
    If you have a pointer and a length, you can always create a 8-bit descriptor:
    Code:
    TPtrC8 ptr(reinterpret_cast<const TUint8 *>(pointer),length);
    Note that WriteL expects the descriptor (so the TPtrC8 object in this case) reachable until you get MaoscBufferCopied, so the descriptor has to be a member variable too (you can use its Set method instead of its constructor).

  3. #3
    Regular Contributor
    Join Date
    Jun 2007
    Location
    Bangalore
    Posts
    208

    Re: Question about RBuf8

    as wizard has pointed out, it need not to be RBuf8, it can be any 8-bit descriptor.

Similar Threads

  1. Replies: 5
    Last Post: 2010-03-11, 13:04
  2. CCalSession -> question
    By rsiudak in forum Symbian
    Replies: 0
    Last Post: 2009-11-04, 16:02
  3. CBase question
    By eric_cartman in forum Symbian
    Replies: 9
    Last Post: 2009-09-09, 19:06
  4. Replies: 0
    Last Post: 2009-08-28, 09:39
  5. Replies: 0
    Last Post: 2003-04-07, 09:52

Posting Permissions

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