Commit Graph

224 Commits

Author SHA1 Message Date
Alexandre Ratchov 6c1c0d3ff6 Remove unnecessary includes. From Michael W. Bombardieri <mb at ii.net>. 2017-01-03 08:05:41 +01:00
Alexandre Ratchov 474ac8d426 log file volume 2017-01-03 07:28:52 +01:00
Alexandre Ratchov 7061de0250 Set device rate to calculated rate. 2016-09-30 11:01:25 +02:00
Alexandre Ratchov 2a451f9623 Fix many typos, from Michael W. Bombardieri <mb at ii.net>, thanks 2016-09-27 14:18:43 +02:00
Alexandre Ratchov 7ddb1a5fe5 Don't rely on the resampling code to calculate the number of samples
to process, as it may produce one extra sample (to handle accumulation
of fractional samples), which would cause access to one sample past
the end of the buffer and crash aucat. Fix this by limiting the number
of samples processed to a single block.

Found by and help from Michael W. Bombardieri <mb at ii.net>. Thanks.
2016-09-27 09:01:21 +02:00
Alexandre Ratchov 61005799d9 simpler resampler 2016-06-09 16:50:56 +02:00
Alexandre Ratchov 10f6027f0f remove unused fields of resamp structure 2016-06-09 16:43:47 +02:00
Alexandre Ratchov 00ffc8f5ab Add resamp_getcnt() routine to calculate the exact number of samples
that would be consumed and produced by the sampler rate converter. Use
it to avoid partial samples that are not properly handled. Fixes
last samples of certain files causing aucat to abort.
2016-06-07 08:11:46 +02:00
Alexandre Ratchov 2562fa7eb4 add -g and -p option to control device and file start position 2016-06-02 18:14:10 +02:00
Alexandre Ratchov a6fdc3b5ed remove forgotten debug printfs 2016-06-02 07:30:30 +02:00
Alexandre Ratchov 474f0ce009 set exit status to 1 if -n is used without -i and -o 2016-06-02 07:07:58 +02:00
Alexandre Ratchov c22cfa6294 sync to openbsd: remove again intermediate conversion to mtc time 2016-06-02 06:55:59 +02:00
Alexandre Ratchov aaf9583451 backout latest 2016-05-31 23:25:38 +02:00
Alexandre Ratchov 751fe73f18 backout mtc units removal 2016-05-31 23:21:15 +02:00
Alexandre Ratchov 2ce73a1421 Pass hr:min:sec:frame.cent to dev_mmcloc() and remove useless
intermediate conversion to 2400-th of second.
2016-05-31 11:24:42 +02:00
Alexandre Ratchov 0798868306 To store MMC position, use samples (at device rate) as time units
instead of 2400-ths of second. No behaviour change.
2016-05-31 10:37:17 +02:00
Alexandre Ratchov e606351421 Fix file block size rounding and ensure it's large enough to store a
full audio block.
2016-05-28 09:28:57 +02:00
Alexandre Ratchov 028bb6e60d When resampling, use the exact resampling factor instead of the ration
between input and output block sizes.  This was inherited from sndion,
but is not required for files because they are continuous streams of
samples and do not need to be split in blocks of equal duration.

This change makes playback/recording rate match exactly the requested
sample rate.
2016-05-27 18:17:05 +02:00
Alexandre Ratchov b347c52869 Flush rec buffer if there's less than one block space left and fill
play buffer if there's less than one block of data left. No behaviour
change, as all input/output are still block-aligned.
2016-05-27 18:00:23 +02:00
Alexandre Ratchov 06c8f4e89f Simplify slot_fill() and slot_flush(). No behaviour change 2016-05-27 17:46:09 +02:00
Alexandre Ratchov 4772005ac1 Give the resamp_do() the exact number input and output samples and
provide routines to calculate them. This way we don't rely on it
anymore to calculate the bytes procuded/consumed. No behaviour change.
2016-05-27 17:36:53 +02:00
Alexandre Ratchov a6ea35ebb3 Make format conversion routines return the number of frames
consumed on both input and output. No behaviour change.
2016-05-26 08:16:17 +02:00
Alexandre Ratchov d6bc5ae04f Check that byte order is native only if we're using more than one
byte per sample, check the samples are lsb-aligned only if there's
padding.
2016-01-29 17:20:34 +01:00
Alexandre Ratchov 6436780b57 fit in 80 columns, trailing spaces, tabs 2016-01-09 09:49:55 +01:00
Alexandre Ratchov 97bf660690 fit in 80 columns, trailing spaces, tabs 2016-01-09 09:35:54 +01:00
Alexandre Ratchov aa4fc43964 move sndiod manual to sec 8 2016-01-07 17:48:47 +01:00
Alexandre Ratchov 56540a0d18 unexpand $OpenBSD$ 2015-10-20 09:16:31 +02:00
Alexandre Ratchov 4d72d01c2c remove unnecessary macros from michael reed 2015-10-20 09:11:34 +02:00
Alexandre Ratchov d91596856b typo 2015-10-01 08:51:48 +02:00
Alexandre Ratchov 9ff8e621d0 typos in comments and strings 2015-08-26 10:27:22 +02:00
Alexandre Ratchov fd7c03518f use lseek to fill with silence 2015-08-23 17:03:02 +02:00
Alexandre Ratchov fc071998df call slot_stop() after draining 2015-05-16 21:23:07 +02:00
Alexandre Ratchov 04d8fe25dd Fix clipping bug in float to fixed point conversion, causing
audible glitches when samples smaller than the quantification
step are converted.
2015-05-04 14:53:28 +02:00
Alexandre Ratchov 8dd18742f2 unbreak usage and macros in manpage, from jmc 2015-01-21 12:31:48 +01:00
Alexandre Ratchov 85855e673a factor header read/write & param checking code 2015-01-08 14:25:46 +01:00
Alexandre Ratchov 76705e06c2 better error messages 2015-01-08 13:10:31 +01:00
Alexandre Ratchov d0e975e33c style 2015-01-08 12:50:24 +01:00
Alexandre Ratchov 7d8a41e152 don't use bits for alaw/ulaw .aiffs 2015-01-07 19:54:25 +01:00
Alexandre Ratchov e418f0cd40 round .aiff chuck size to 2 2015-01-07 18:37:35 +01:00
Alexandre Ratchov 6cb13736a2 better file format names 2015-01-07 15:54:14 +01:00
Alexandre Ratchov 7188d4fcc5 .au header comment is mandatory 2015-01-07 14:21:46 +01:00
Alexandre Ratchov 901675b4f2 fix .au start position 2015-01-07 13:56:38 +01:00
Alexandre Ratchov d33d443b3a support for .au files 2015-01-07 12:07:37 +01:00
Alexandre Ratchov 56e9456e0e fix initial offset 2015-01-06 12:52:10 +01:00
Alexandre Ratchov 57d34508c5 support aifc files 2015-01-06 12:49:08 +01:00
Alexandre Ratchov 50ba55b32f tell about .aiff files in doc 2015-01-06 11:44:38 +01:00
Alexandre Ratchov f2c235166b add support for aiff files 2015-01-06 11:41:24 +01:00
Alexandre Ratchov 2e1306cbeb s/afile_xxxmap/dec_xxxmap 2015-01-05 18:02:41 +01:00
Alexandre Ratchov 1341ff77a4 s/wav/afile/ 2015-01-05 18:01:29 +01:00
Alexandre Ratchov 7e4b5c54d9 merge alaw and mulaw code 2014-12-30 19:36:15 +01:00