[Openal] Can someone explain signed vs. unsigned audio
George Warner
geowar at apple.com
Tue Sep 2 11:48:52 PDT 2008
On Sat, 30 Aug 2008 19:55:33 -0400, "Kyle D. Jansen"
<kdjansen at args.k12.va.us> wrote:
> Then what is the difference between signs, since, as far as the bits, [signed]
> -128 == [unsigned] 0?
The only difference in how the data is stored. Ether way the sound you hear
is the same. You can convert between signed and unsigned by XORing the top
bit:
Signed value = unsigned value ^ 0x80;
Unsigned value = signed value ^ 0x80;
> Further, how is volume heard? ie, is -127 as "loud" as 127? I'm doing
> calculations with the psychological volume, and I want to be clear on this.
If your computer is outputting a constant value then you won't hear
anything; sound requires change (frequency) in order to be heard.
That said, if your (Mac) computer is outputting a sine wave it would start
at zero and curve up to +127, curve back down to zero and continue curving
down until it reached -128 and then curve back up to zero where the cycle
would repeat.
If it bottomed out at -127 instead of -128 then in theory it wouldn't be a
loud however this is such a small difference that in practice it probably
wouldn't be noticeable.
--
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)
More information about the Openal
mailing list