Commit graph

13 commits

Author SHA1 Message Date
Roderick van Domburg
5f26a745d7 Add support for S32 output format
While at it, add a small tweak when converting "silent" samples
from float to integer. This ensures 0.0 converts to 0 and vice
versa.
2021-03-13 23:43:24 +01:00
Roderick van Domburg
5257be7824 Add command-line option to set F32 or S16 bit output
Usage: `--format {F32|S16}`. Default is F32.

 - Implemented for all backends, except for JACK audio which itself
 only supports 32-bit output at this time. Setting JACK audio to S16
 will panic and instruct the user to set output to F32.

 - The F32 default works fine for Rodio on macOS, but not on Raspian 10
 with Alsa as host. Therefore users on Linux systems are warned to set
 output to S16 in case of garbled sound with Rodio. This seems an issue
 with cpal incorrectly detecting the output stream format.

 - While at it, DRY up lots of code in the backends and by that virtue,
 also enable OggData passthrough on the subprocess backend.

 - I tested Rodio, ALSA, pipe and subprocess quite a bit, and call on
 others to join in and test the other backends.
2021-03-12 23:09:15 +01:00
Roderick van Domburg
f29e5212c4 High-resolution volume control and normalisation
- Store and output samples as 32-bit floats instead of 16-bit integers.
   This provides 24-25 bits of transparency, allowing for 42-48 dB of
   headroom to do volume control and normalisation without throwing
   away bits or dropping dynamic range below 96 dB CD quality.

 - Perform volume control and normalisation in 64-bit arithmetic.

 - Add a dynamic limiter with configurable threshold, attack time,
   release or decay time, and steepness for the sigmoid transfer
   function. This mimics the native Spotify limiter, offering greater
   dynamic range than the old limiter, that just reduced overall gain
   to prevent clipping.

 - Make the configurable threshold also apply to the old limiter, which
   is still available.

Resolves: librespot-org/librespot#608
2021-03-12 23:09:15 +01:00
Philippe G
34bc286d9b ogg passthrough
rename
2021-02-22 13:45:53 -08:00
Sasha Hilton
37a5796a86 Add option to choose between track or album normalisation gain, default album. 2021-01-21 19:16:05 +00:00
Ash
ef27b4bce3
Disable gapless playback via runtime flag (#444)
* Enable gapless playback via runtime flag

* Set gapless playback as default, use `--disable-gapless` to turn it off

* Ensure sink restarts b/w tracks when gapless is disabled
2020-03-10 13:00:57 +01:00
Sasha Hilton
237ef1e4f9 Format according to rustfmt 2018-02-26 02:50:41 +01:00
Sasha Hilton
bde157fad7
Merge branch 'master' into events-on-prev-next 2018-02-24 20:16:28 +01:00
Sasha Hilton
f8db550e5e Add volume normalisation support 2018-02-23 20:08:20 +01:00
Simon Persson
93af49aadf Send player event messages over futures aware channel. 2018-02-20 23:12:29 +01:00
Simon Persson
1b943d069f Move PlayerEvent into player. 2018-02-20 21:57:42 +01:00
Simon Persson
b0ee03112f First attempt at a better playback event system. 2018-02-16 00:16:38 +01:00
awiouy
191caca518 core API: move Bitrate and PlayerConfig from core to playback 2018-02-11 23:55:41 +01:00