FidoNet Echomail Archive

<<< Previous Index Next >>>

From: Peter Haywood
To: Rob Adams
Date: 1997-08-19 03:24:16
Subject: Re: converting sound data

Groovy hepcat Rob Adams jived with Danny Keogh on 27 Jul 97  14:21:45!
converting sound data's a cool scene. Dig it!

 DK> Ok, peoples!  I thought I knew how to do this but when I tried it
 DK> it didn't work.  No code is needed, I just need to know how to
 DK> convert a 16-bit sample to an 8-bit sample...  That's it.
 RA> Count every 2nd bit?

  What if you had the following value?

0xAAAA (binary 1010101010101010)

  As you can see, every second bit of this value is 0. Therefore,
counting every second bit will produce a result of 0x00. This is most
definately not what is wanted.

 RA> or maybe a little more tricky... (int)(bit1+bit2)/2

  Why bother messing about with bits, anyhow? Just use a shift
operation to get rid of the low 16 bits.


... Never trust a skinny cook. - Sumo wrestler
--- Blue Wave/RA v2.20
 * Origin: The Gate, Melbourne Australia, +61-3-9809-5097 33.6k  (3:633/159)
SEEN-BY: 622/419 632/107 360 633/154 159 260 267 270 371 373 635/728 638/102
SEEN-BY: 639/252 670/218 711/410
@PATH: 633/159 154 260 632/360 635/728 633/267

<<< Previous Index Next >>>