Commit Graph

225 Commits

Author SHA1 Message Date
mrg 707adea339 match message & conversion function name properly.
probably should make this into an array with two members.
2024-03-20 20:19:31 +00:00
mrg eb1fa7eb4a audio_wav_parse_hdr: handle zero-length data files again
the previous clean up turns zero-length data into no data and thus
an error, instead of simply doing nothing.  noted by gson.
2024-03-20 20:18:39 +00:00
mrg 21fadbc4fc fix some sizeof() confusion.
using "const char search[4]" as a function parameter means that
"search" is actually a pointer type so "sizeof search" returns
8 on 64-bit platforms.  i mis-read this and used "sizeof *search"
which is always 1, noted by rillig.

instead of trying to avoid writing "4" twice, put it in a define
and use that in various places instead.  annoying.
2024-03-14 00:00:31 +00:00
mrg c783de976f audioplay(1): handle mis-aligned RIFF chunks.
put the code to find RIFF chunks into a new find_riff_chunk() function,
and handle mis-aligned chunk lengths.  can now play files with chunks
that say they are 7 bytes long, and have 1 byte padding.

add some -V -V extra-verbose for the wav parser.
2024-03-12 00:34:38 +00:00
mrg cfa155a807 minor clean up in the RIFF/WAVE header checking.
use memcmp() not strncmp() to check for "RIFF" and "WAVE".
avoid endian convesion on part.len 3 times.
2024-03-11 23:12:29 +00:00
mrg c62cdc0d11 be sure to byte swap ext.len when checking/printing it.
noted by rillig@.
2024-03-11 19:17:52 +00:00
mrg b4c3b934ba 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.
2024-03-08 06:57:59 +00:00
mrg 29d939f7c2 audioplay: add -n flag that doesn't write audio data.
this will be used in an upcoming testsuite for the wav parser.
2024-03-04 06:29:35 +00:00
gson cca8938d5b Clean up lines containing only tabs. 2024-02-27 21:05:34 +00:00
gson ca24696e6c Clean up lines containing only spaces. 2024-02-27 20:40:29 +00:00
mrg 2026b7285b update my email address. 2024-02-04 05:43:05 +00:00
gutteridge 7408a707bd audioplay.1: fix sentence punctuation 2023-06-30 23:36:47 +00:00
mlelstv 0d3e86e02e Revert accidentially committed part. The 'latency' report isn't ready
to be useful.
2023-04-15 16:54:39 +00:00
mlelstv 3375d27c67 Add support for recording 24bit wav files. 2023-04-15 12:39:44 +00:00
uwe 7f25702515 audioplay(1): fix typo
From Jim Spath in PR/57228
2023-02-13 13:35:45 +00:00
andvar 5a58ccfbec fix various typos in comments, documentation and messages.
mainly s/paramater/parameter/ and s/reduntant/redundant/.
2022-08-07 11:06:18 +00:00
mrg f1050dd1d7 fix verbose log for 64 bit float 2022-05-15 02:16:06 +00:00
mlelstv 8a61065f27 Let user gracefully abort recording with SIGINT. 2022-01-09 06:33:13 +00:00
riastradh 36d4e80c28 audiorecord(1): Handle read(2) return value gracefully. 2021-06-01 21:08:48 +00:00
nia e11a27e948 Add an example for recording CD quality audio 2021-03-25 10:03:26 +00:00
nia bc9df35069 audioctl.1: describe foibles 2021-03-21 10:50:08 +00:00
gutteridge c8a27b6c18 audioplay.1: generalize a reference to web browsers 2020-04-10 21:33:27 +00:00
sevan 0374e60ed5 audioamd is in the SPARC port 2020-01-31 00:21:53 +00:00
wiz 5b72b9d868 Remove list of audio drivers, moved to audio(4). 2019-11-12 12:50:30 +00:00
joerg 856452fc2a Spell the largest 32bit signed value as INT32_MAX. Explicitly cast to
float, because it is not precisely representable.
2019-11-11 15:40:42 +00:00
wiz 899b15813c Fix a typo. Fix some xrefs, comment out references to non-existing man pages. 2019-11-11 11:04:15 +00:00
mrg e130416089 copyright maint. 2019-11-09 12:54:34 +00:00
mrg 95676db785 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.
2019-11-09 12:46:44 +00:00
wiz f96f071847 Sort options (no-argument options before ones demanding arguments).
Bump date.
2019-05-09 09:37:11 +00:00
isaki 017c116c97 Remove -p option. AUDIO_SETCHAN is insecure and is obsoleted. 2019-05-08 14:44:42 +00:00
isaki fd2a21e429 Use err(3)/errx(3) properly to avoid "write failed: Undefined error: 0". 2019-05-04 08:27:30 +00:00
mlelstv dd276a2ec2 The test for regular file was wrong.
From yarl on freenode, thanks!
2018-11-16 13:55:17 +00:00
jdolecek c8469e9019 need getle16() for ext.sub_tag too
PR bin/52762 by Yosuke Sugahara
2017-11-25 17:18:15 +00:00
nat cf3b979950 Renane ioctl AUDIO_SETPROC to AUDIO_SETCHAN.
Add an ioctl to return channel number (AUDIO_GETCHAN). This can be used
on audio/sound/audioctl devices.

Return EIO in read/write/ioctl/poll/stat if fp has been closed or is
invalid.

Update audio.4, audioio.h and audioctl(1) to reflect these changes.
2017-03-21 07:04:29 +00:00
nat f835d36292 Audio now uses fdclone, there is no longer a limitation of one audio
instance per process.  Virtual channels are placed in a queue, so there is
no longer a compile time limit of VAUDIOCHANS.

A new sysctl has been added to control multiple user access.
Mixer labels on virtual channels are now prefixed by vchan.

audiobell.c and audioctl have been updated to reflect these changes.

Use of fdclone was posted to tech-kern@ and improvements made.
Multiuser access control changes and the use of a queue were suggessted by
pgoyette@
2017-02-10 19:31:42 +00:00
nat 82924a36bf The audio sub-system now supports the following features as
posted to tech-kern:

    * Simultaneous playback and mixing of multiple streams
    * Playback streams can be of different encoding, frequency, precision
      and number of channels
    * Simultaneous recording to different formats
    * One audio device per process
    * Sysctls to set the common format frequency, precision and channels
    * Independent mixer controls for recording/playback per stream
    * Utilizes little cpu time for multiple streams / good performance
    * Compatible with existing programs that use OSS/NetBSD audio
    * Changes to audioctl(1) to allow specifying process id for corresponding
      audio device
2016-12-08 10:28:44 +00:00
mrg a0e3e3912d rename struct write_info as struct track_info, and the variable name 'wi'
as 'ti', as this info is useful for reading as well.
2015-08-05 06:54:39 +00:00
mrg 3a70beec89 separate the 3 functions midirecord uses from libaudio.a into its own
file and link it directly, instead of having an (implicit) dependancy
on usr.bin/audio/common being built before usr.bin/midirecord is linked.
2015-06-21 06:06:01 +00:00
mrg 9dd3b8ae69 add a decode_uint() function. 2014-12-30 01:22:09 +00:00
riastradh 6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
christos 6e28978d84 fix unused variable warnings 2013-10-18 20:47:06 +00:00
mrg 0c2e06460b 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.
2013-08-30 20:57:26 +00:00
wiz a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
christos 48adc0d0fe PR/45384: Henning Petersen: Swapped arguments in lseek 2011-09-21 14:32:14 +00:00
jmcneill a123dfbe30 recognize AUDIO_ENCODING_AC3 2011-09-06 22:41:53 +00:00
joerg c36a7298be ANSIfy. Add static. Add __dead. 2011-08-28 01:17:47 +00:00
wiz 90bb351524 Sort usage. 2010-12-29 18:49:41 +00:00
wiz 7072bc9c3f Use better reference after sorting in -f description. 2010-12-29 18:48:56 +00:00
wiz 29bd138c93 Sort usage. 2010-12-29 18:48:40 +00:00
wiz 825164c33e Sort some more. 2010-12-29 18:46:48 +00:00