From: Jason Clary <[EMAIL PROTECTED]>
Subject: RE: Raw PCM Sample = UCHAR?

Clearly he's looking to deal with 16bit audio, which won't fit a single
sample in an unsigned char, but if the encoder is looking for two chars
per sample, depending on the byteorder of the system, you can probably
cast a 16bit integer array as an unsigned char array of exactly double
the length and have it work.

The other option is something akin to bcopy (There are some
platform-specific implementations).  bcopy from an integer array to a
char array should work just fine, then you don't have to worry about
things complaining about typecasting.  That would be better than trying
to manually split the integers yourself since bcopy is generally a very
fast one-pass process.



-----Original Message-----
From: RealForum [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 29, 1999 6:37 PM
Subject: Re: Raw PCM Sample = UCHAR?


From: "Craig A. Schultz" <[EMAIL PROTECTED]>
Subject: Re: Raw PCM Sample = UCHAR?

Hi,
      If you can caste it from one to the other, you can store it that
way.
That is generally true.  In some cases unsigned to signed can be a
problem but
not with data generally.  Is  a "short integer" buffer = to  "char" on
your
system,( being only a Windoze guy) myself,?  If so, you can basically
freely
caste between the two.  One good test, if it compiles, it might work, if
it
don't compile, forget it.  ;-)
Craig


*******************************************************
The RealForum is an email discussion group focused on using RealNetworks
products. The RealForum is a place to post messages about the best methods
for creating content using RealNetworks technologies and the planning and
implementation of streaming-media web sites.  Archives of RealForum can
be found at http://realforum.real.com

If you ever want to remove yourself from this mailing list,
you can send mail to <[EMAIL PROTECTED]> with the following
command in the body of your email message:

    unsubscribe realforum

or from another account, besides the address you subscribed with:

    unsubscribe realforum <[EMAIL PROTECTED]>

Reply via email to