On Wed, 14 Sep 2016 08:24:45 +0200
Alexandre Ratchov <a...@caoua.org> wrote:

> the diff was forgotten, it's discussed here:
> 
> http://marc.info/?l=openbsd-ports&m=145505706611958
> 
> It's about playing 24-bit files with full precision (assuming audio
> sub-system supports it), i.e.  without converting samples to 16-bit
> first and loosing 8-bits of precision.
> 
> OK?
 
[diff omitted]

Thank you Alexandre, this is nice!

Both playback and recording with 24bit precision appear to work for me.
(Recording turntable->phono preamp->line-in on the on-board sound card.)

One thing I noticed:
when recording with sndiod running, sox prints
"Precision      : 24-bit"
but when sndiod is disabled, it prints
"Precision      : 32-bit"
when using the same command. The resulting files are in the same format
though - here is the full transcript of how I checked that:

HAMLET: /tmp/0 $ doas rcctl start sndiod
sndiod(ok)

HAMLET: /tmp/0 $ rec -t wav -c 2 -r 48000 -b 24 test1.wav   

Input File     : 'default' (sndio)
Channels       : 2
Sample Rate    : 48000
Precision      : 24-bit
Sample Encoding: 24-bit Signed Integer PCM

In:0.00% 00:00:08.36 [00:00:00.00] Out:397k  [!=====|=====!] Hd:0.0 Clip:0    ^C
Aborted.

HAMLET: /tmp/0 $ doas rcctl stop sndiod
sndiod(ok)

HAMLET: /tmp/0 $ rec -t wav -c 2 -r 48000 -b 24 test2.wav 

Input File     : 'default' (sndio)
Channels       : 2
Sample Rate    : 48000
Precision      : 32-bit
Sample Encoding: 32-bit Signed Integer PCM

In:0.00% 00:00:15.45 [00:00:00.00] Out:737k  [  ====|===-  ] Hd:1.2 Clip:0    ^C
Aborted.

HAMLET: /tmp/0 $ file *
test1.wav: RIFF (little-endian) data, WAVE audio, stereo 48000 Hz
test2.wav: RIFF (little-endian) data, WAVE audio, stereo 48000 Hz

HAMLET: /tmp/0 $ ffmpeg -i test1.wav 2>&1 | grep Stream                         
                          
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, 
s32 (24 bit), 2304 kb/s

HAMLET: /tmp/0 $ ffmpeg -i test2.wav 2>&1 | grep Stream 
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, 
s32 (24 bit), 2304 kb/s

Reply via email to