Convert 8-bit signed linear data to unsigned for .wav files.

This commit is contained in:
mycroft 2004-07-19 19:27:59 +00:00
parent 680669cd36
commit 26fc0dfe09

View File

@ -1,4 +1,4 @@
/* $NetBSD: record.c,v 1.37 2004/07/19 19:15:05 mycroft Exp $ */
/* $NetBSD: record.c,v 1.38 2004/07/19 19:27:59 mycroft Exp $ */
/*
* Copyright (c) 1999, 2002 Matthew R. Green
@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: record.c,v 1.37 2004/07/19 19:15:05 mycroft Exp $");
__RCSID("$NetBSD: record.c,v 1.38 2004/07/19 19:27:59 mycroft Exp $");
#endif
@ -571,7 +571,9 @@ write_header_wav(hdrp, lenp, leftp)
#if BYTE_ORDER == BIG_ENDIAN
case AUDIO_ENCODING_SLINEAR:
#endif
if (bps == 16)
if (bps == 8)
conv_func = change_sign8;
else if (bps == 16)
conv_func = swap_bytes;
else if (bps == 32)
conv_func = swap_bytes32;
@ -592,6 +594,8 @@ write_header_wav(hdrp, lenp, leftp)
#if BYTE_ORDER == LITTLE_ENDIAN
case AUDIO_ENCODING_SLINEAR:
#endif
if (bps == 8)
conv_func = change_sign8;
fmt_pcm:
fmttag = WAVE_FORMAT_PCM;
fmtsz = 16;