Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/audio/record WAV seems to be signed only; convert un...
details: https://anonhg.NetBSD.org/src/rev/beb25d32029b
branches: trunk
changeset: 520761:beb25d32029b
user: mrg <mrg%NetBSD.org@localhost>
date: Tue Jan 15 17:17:13 2002 +0000
description:
WAV seems to be signed only; convert unsigned samples.
diffstat:
usr.bin/audio/record/record.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diffs (42 lines):
diff -r 943f0fd3f28e -r beb25d32029b usr.bin/audio/record/record.c
--- a/usr.bin/audio/record/record.c Tue Jan 15 17:10:06 2002 +0000
+++ b/usr.bin/audio/record/record.c Tue Jan 15 17:17:13 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: record.c,v 1.19 2002/01/15 17:02:52 mrg Exp $ */
+/* $NetBSD: record.c,v 1.20 2002/01/15 17:17:13 mrg Exp $ */
/*
* Copyright (c) 1999 Matthew R. Green
@@ -462,19 +462,28 @@
/*
* we could try to support RIFX but it seems to be more portable
* to output little-endian data for WAV files.
- *
- * XXX signed vs unsigned matters probably! cope!
*/
case AUDIO_ENCODING_ULINEAR_BE:
+ if (bps == 16)
+ conv_func = change_sign16_swap_bytes_be;
+ else if (bps == 32)
+ conv_func = change_sign32_swap_bytes_be;
+ goto fmt_pcm;
case AUDIO_ENCODING_SLINEAR_BE:
if (bps == 16)
conv_func = swap_bytes;
else if (bps == 32)
conv_func = swap_bytes32;
+ goto fmt_pcm;
+ case AUDIO_ENCODING_ULINEAR_LE:
+ if (bps == 16)
+ conv_func = change_sign16_le;
+ else if (bps == 32)
+ conv_func = change_sign32_le;
/* FALLTHROUGH */
+ case AUDIO_ENCODING_SLINEAR_LE:
case AUDIO_ENCODING_PCM16:
- case AUDIO_ENCODING_ULINEAR_LE:
- case AUDIO_ENCODING_SLINEAR_LE:
+fmt_pcm:
fmttag = WAVE_FORMAT_PCM;
fmtsz = 16;
align = channels * (bps / 8);
Home |
Main Index |
Thread Index |
Old Index