×

Discussion Board

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

    Question Playing a PCM16 stream

    Hello everyone,

    I have a serious problem I don't know how to solve. I have a stream of data that is stored in a fixed array at the moment like this:

    Code:
    TFixedArray<TInt16, 50> iBuff;
    I'm trying to play it via CMdaAudioOutputStream* iAudioStream pointer. Problem is that AudioOutputStream takes an 8 bit descriptor const TDesC8 & aData as input. I managed to play the audio stream by casting the array, like this:

    Code:
    TPtrC8 iCPtr;
    iCPtr.Set(reinterpret_cast<TUint8*>(&iBuff),sizeof(iBuff));
    iAudioStream->WriteL(iPtr));
    But that, is not an acceptable solution because casting a signed integer in unsigned integer modifies data. Can someone tell me how to get my data to audio device without it being spoiled?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Playing a PCM16 stream

    Casting a pointer does not alters the data, and in this particular case casting happens only to package your data into a 8-bit descriptor. Although I used reinterpret_cast, the descriptor actually does not 'interpret' anything.

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    104

    Re: Playing a PCM16 stream

    Quote Originally Posted by wizard_hu_ View Post
    Casting a pointer does not alters the data, and in this particular case casting happens only to package your data into a 8-bit descriptor. Although I used reinterpret_cast, the descriptor actually does not 'interpret' anything.
    Thanks. Your reply made me realise I was looking for an error in the wrong place. Finally found the bug

Similar Threads

  1. Gap playing RTSP stream in S60
    By Tiger79 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2009-08-18, 09:02
  2. Problem with Audio Stream - stops playing
    By michi2805 in forum Audio
    Replies: 2
    Last Post: 2009-04-15, 11:19
  3. player freeze when playing from stream
    By jdesmedt in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2009-02-06, 09:32
  4. Anyone know the problem of stream playing?
    By miqitangguo in forum Symbian Media (Closed)
    Replies: 6
    Last Post: 2008-03-18, 09:26
  5. Half Duplex Audio Streaming
    By subhrajyotisaha in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2006-05-25, 04:39

Posting Permissions

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