"Peter P." <peterparker@xxxxxxxxxxxx> writes: > * Måns Rullgård <mans@xxxxxxxxx> [2023-05-23 15:17]: > [...] >> > If I understand it correctly, SoX is using (at least) 32bit floating >> > point numbers internally, no? >> >> SoX uses 32-bit integers internally, although some effects use >> floating-point in their calculations. > All clear. > >> > I think we do not need a command line option to scale the input by a >> > certain factor, we have the "norm" and "gain" effects to do that. Do >> > you know where the clipping of values outside of -1 and 1 happens for >> > 32bit input files? Does it happen when SoX reads the file, or when it >> > applies an effect, or when it writes a file? >> >> In this case, the clipping happens when the samples are read from the >> file and converted to 32-bit integers. > I see. > >> Changing any of this would be a lot of work only for the sake of >> "supporting" a certain type of invalid file. What is the origin of >> your bad files? Can't you fix the problem there? > To me, and possibly many others, the possibility to write amplitudes > outside of the range that will be clipped by the DAC is a big plus. > It can be used to compensate for errors that you'd otherwise be unable to > correct. Excess levels can take place during various offline processing > of soundfiles, for example using the CDP (Composer's Desktop Project) > programs, or digital sound synthesis. Of yourse you can say "correct the > mistakes there", but this is missing the point of making SoX even > better, and make it support features that other programs (Audacity) > handle well, eg. reading these files without clipping and allowing to > rescale amplitudes to more sane ranges then. Yes, rewriting SoX to use floating-point everywhere internally would be very nice. Unless you're willing to put in the effort yourself or pay someone to do it (I estimate about a month's worth of work, or $10k to $20k), complaining about it here is a waste of your time. If you are determined to keep producing invalid files, you could, with much less effort, write a simple pre-processor to rescale them as needed. -- Måns Rullgård _______________________________________________ Sox-users mailing list Sox-users@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/sox-users