Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupted FLAC files when recording levels >0dBFS #53

Open
teodly opened this issue Jan 28, 2023 · 0 comments
Open

Corrupted FLAC files when recording levels >0dBFS #53

teodly opened this issue Jan 28, 2023 · 0 comments

Comments

@teodly
Copy link

teodly commented Jan 28, 2023

This will never occur when capturing from (sane) audio interfaces, but may be a problem when capturing output of other apps or "what the user hears" (jack_capture launched without ports specified).

When converting from floats to ints, jack_capture should clamp levels to be between INT_MIN, INT_MAX.

How to reproduce:

  • launch JACK audio server
  • reduce audio interface volume to the minimum
  • jack_capture -c 2 -f flac
  • and in different terminal: ffmpeg -f lavfi -i sine=440,volume=9 -sample_rate 48000 -f f32le - | jack-stdin -e float system:playback_1

You should hear a slightly distorted sine wave (because JACK truncates properly). When you try to open the resulting FLAC file, strange things happen. Audacity will show clipping properly but Amplify effect will indicate that peak is +48dBFS (something impossible in integer FLAC file!). After applying -48dB gain noise can be heard in the distorted fragment.

flac --test jack_capture_01.flac checksum verification will fail.

jack_capture version: 0.9.73 (Ubuntu 20.04)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant