Home | History | Annotate | Download | only in common
History log of /src/usr.bin/audio/common/libaudio.h
RevisionDateAuthorComments
 1.22  08-Mar-2024  mrg audio_wav_parse_hdr(): avoid buffer overreads and clean up

reimplement most of this function using a new method of buffer
management to ensure that we never read beyond the provided size.

properly handle RIFF chunk lengths, instead of assuming various
offsets from most files are right.

update list of consumed documentation and fill the list of WAVE
formats from RFC 2361 (most remain not supported.)

should fix PR#57973.

tested against a large number of .wav files i have handy and with
a testsuite generator that should be incoming soon.
 1.21  09-Nov-2019  mrg branches: 1.21.8;
add support for playing IEEE float32 and float64 RIFF WAVE
samples on platforms that have these types natively, and
can handle signed linear 32 bit samples. explicitly
disabled on vax, run-or-compile-time sizeof() check
disabled for everyone else

now i can play a float32 .wav file i found.
float64 not tested.

copyright maint, update HISTORY, update audio drivers list.
 1.20  05-Aug-2015  mrg branches: 1.20.8; 1.20.16; 1.20.18;
rename struct write_info as struct track_info, and the variable name 'wi'
as 'ti', as this info is useful for reading as well.
 1.19  30-Dec-2014  mrg add a decode_uint() function.
 1.18  30-Aug-2013  mrg branches: 1.18.4;
move most of the header writing code from record.c into wav.c and sun.c.

introduce a struct write_info for communication between front ends and
backends.

libaudio API is still pretty ugly, and needs to stay local here for now,
but it is a little more usable for other tools now.
 1.17  28-Aug-2011  joerg branches: 1.17.2; 1.17.8;
ANSIfy. Add static. Add __dead.
 1.16  18-Jun-2009  mrg - add extended WAVE header support
- attempt to play a bunch more WAV files
 1.15  29-May-2008  mrg branches: 1.15.4; 1.15.10;
remove clause #3 from my license where there are no other
copyright holders involved.
 1.14  11-May-2006  mrg branches: 1.14.20; 1.14.22;
variable signed/unsigned cleanup.
 1.13  01-Jul-2004  drochner put the __packed__ attribute close to the struct definition
(to appease gcc-3.4), and use the compiler-independant __packed
form for consistency
 1.12  21-Jan-2004  mrg apply the patch from PR#24127: make audio_wav_parse_hdr() take u_int *
parameters for encoding, precision, sample rate and channels.
 1.11  10-Feb-2002  mrg - add a AUDIO_FORMAT_DEFAULT. use it. don't change functionity.

- fix the function selection in sunau conversions.

- be more verbose when given -V. (hi lennart! :)
 1.10  15-Jan-2002  mrg - WARNS=3 (from ross@netbsd.org)
- fix a bug in WAV conversions
 1.9  15-Jan-2002  mrg - add rudimentary "wav" recording support: don't think it copes with
big-endian systems properly yet -- need to add RIFX support or swap
samples while writing. more on this coming soon.

- new "-F <format>" option for audiorecord. supported values of <format>
are "sun", "wav" and "none", plus a few aliases.

- split sun & wav support out into their own files.

- don't assume that WAV header elements are properly aligned for the
type of data they hold.

XXX: still need to clean up libaudio interfaces a lot.
 1.8  01-Jan-2002  mrg fix 2001/03/04 change: audio_parse_wav_hdr() returns a signed value.
 1.7  04-Mar-2001  hubertf Don't play trailing garbage at end of RIFF WAVE (.wav) files
Patch sent by YAMAMOTO Takashi <takashi.yamamoto@bigfoot.com> in PR 12328
 1.6  22-Dec-2000  mrg de-__P()-ify
 1.5  13-Dec-2000  mrg libaudio:
- rename audio_get_sun_encoding() to audio_sun_to_encoding()
- add audio_encoding_to_sun()
play.c:
- adapt
record.c:
- convert NetBSD encoding to sun encoding if possible, otherwise don't
output a header at all.
fixes PR#10380 from Michael Eriksson <eramore@era-t.ericsson.se>.
 1.4  18-Jun-2000  mrg branches: 1.4.2;
remove unused crap.
 1.3  27-Mar-1999  mrg branches: 1.3.8;
make recording precision/encoding setting sane.
 1.2  26-Mar-1999  mrg add missing copyrights.
 1.1  26-Mar-1999  mrg add audiorecord and audioplay tools. audioplay does .au and .wav files. audiorecord makes .au files only. uses parts of audioctl..
 1.3.8.1  23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.2.2  29-Jan-2002  he Pull up revisions 1.5-1.6,1.8-1.10 (via patch, requested by mrg):
Bring in several fixes and enhancements to these tools:
o fix stdin audioplay
o add WAV support to audiorecord
o allows any host to output any endian sample
o don't output a bogus header
o fix a bug in audiorecord -t
o many manual page fixes
o exit immediately on signals
 1.4.2.1  11-Mar-2001  he Pull up revision 1.7 (via patch, requested by hubertf):
Do not play trailing garbage at the end of RIFF WAVE (.wav) files.
Fixes PR#12328.
 1.14.22.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.14.20.1  04-Jun-2008  yamt sync with head
 1.15.10.1  21-Apr-2010  matt sync to netbsd-5
 1.15.4.1  23-Jun-2009  snj Pull up following revision(s) (requested by mrg in ticket #825):
usr.bin/audio/common/libaudio.h: revision 1.16
usr.bin/audio/common/wav.c: revision 1.9
- - add extended WAVE header support
- - attempt to play a bunch more WAV files
 1.17.8.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17.2.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18.4.1  12-Jan-2015  martin Pull up following revision(s) (requested by mrg in ticket #409):
usr.bin/audio/common/audio.c: revision 1.23
usr.bin/audio/common/libaudio.h: revision 1.19
add a decode_uint() function.
 1.20.18.1  12-Mar-2024  martin Pull up the following revisions, requested by mrg in ticket #1818:

usr.bin/audio/common/auconv.h up to 1.6
usr.bin/audio/common/audio.c up to 1.27
usr.bin/audio/common/decode.c up to 1.2
usr.bin/audio/common/libaudio.h up to 1.22
usr.bin/audio/common/sun.c up to 1.11
usr.bin/audio/common/wav.c up to 1.22
usr.bin/audio/ctl/audioctl.1 up to 1.25
usr.bin/audio/play/audioplay.1 up to 1.34
usr.bin/audio/play/play.c up to 1.64
usr.bin/audio/record/audiorecord.1 up to 1.45
usr.bin/audio/record/record.c up to 1.58

- support for playing 32-bit and 64-bit IEEE FP .wav files
- support for recording 24 bit .wav files
- read-overflow fixes for .wav files, and other fixes for the
wav parser
- audioplay gains -n flag (no play, like make -n)
- audioctl manual spruced up
- audiorecord manual gained useful examples
 1.20.16.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.20.8.1  12-Mar-2024  martin Pull up the following revisions, requested by mrg in ticket #1948:

usr.bin/audio/common/auconv.h up to 1.6
usr.bin/audio/common/audio.c up to 1.27
usr.bin/audio/common/decode.c up to 1.2
usr.bin/audio/common/libaudio.h up to 1.22
usr.bin/audio/common/sun.c up to 1.11
usr.bin/audio/common/wav.c up to 1.22
usr.bin/audio/play/audioplay.1 up to 1.34
usr.bin/audio/play/play.c up to 1.64
usr.bin/audio/record/audiorecord.1 up to 1.45
usr.bin/audio/record/record.c up to 1.58

- support for playing 32-bit and 64-bit IEEE FP .wav files
- support for recording 24 bit .wav files
- read-overflow fixes for .wav files, and other fixes for the
wav parser
- audioplay gains -n flag (no play, like make -n)
- audiorecord manual gained useful examples
 1.21.8.1  12-Mar-2024  martin Pull up the following revisions, requested by mrg in ticket #634:

usr.bin/audio/common/auconv.h up to 1.6
usr.bin/audio/common/audio.c up to 1.27
usr.bin/audio/common/decode.c up to 1.2
usr.bin/audio/common/libaudio.h up to 1.22
usr.bin/audio/common/sun.c up to 1.11
usr.bin/audio/common/wav.c up to 1.22
usr.bin/audio/play/audioplay.1 up to 1.34
usr.bin/audio/play/play.c up to 1.64
usr.bin/audio/record/audiorecord.1 up to 1.45
usr.bin/audio/record/record.c up to 1.58

- support for recording 24 bit .wav files
- read-overflow fixes for .wav files, and other fixes for the
wav parser
- audioplay gains -n flag (no play, like make -n)

RSS XML Feed