aucat -e u16le doesn't work

From: James Cook <falsifian_at_falsifian.org>
Date: Thu, 10 Dec 2020 04:14:31 +0000
As far as I can tell, aucat's u16le encoding is broken and behaves the
same as s16le (on my little-endian amd64 system).

For example:

  aucat -c 0:0 -r 48000 -e u16le -i unsigned_samples

sounds garbled (where unsigned_samples has raw 16-bit little-endian
unsigned samples), but if I pass in a file with signed samples instead,
it sounds fine:

  aucat -c 0:0 -r 48000 -e u16le -i signed_samples

(that last command also works if I pass the correct encoding, "s16le",
instead of "u16le" --- it sounds the same either way).

I also observe this with conversion. Here is an easy-to-reproduce
example:

  aucat -n -e s16le -i /dev/zero -e u16le -o - | hexdump -v | head

This shows all zeros:

falsifian angel ~ $ aucat -n -e s16le -i /dev/zero -e u16le -o - | hexdump -v | head
0000000    0000    0000    0000    0000    0000    0000    0000    0000
0000010    0000    0000    0000    0000    0000    0000    0000    0000
...

but it should have changed the samples to 0x8000. By contrast,
s16be->u16be or s32le->u32le seem to behave correctly, e.g.:

falsifian angel ~ $ aucat -n -e s16be -i /dev/zero -e u16be -o - | hexdump -v | head
0000000    0080    0080    0080    0080    0080    0080    0080    0080
0000010    0080    0080    0080    0080    0080    0080    0080    0080
...

I'm using aucat on OpenBSD current on an amd64 system.

Please cc me on replies.

-- 
James
Received on Thu Dec 10 2020 - 05:14:31 CET

This archive was generated by hypermail 2.3.0 : Tue Aug 09 2022 - 16:23:50 CEST