Re: Prevent SoX from doing the clipping?

Danijel DOMAZET <[email protected]>
Newsgroups gmane.comp.audio.sox
Message-ID <CAB+hYN0KD6LNS5ykf2U2nhABSkFSW=eGg3N=ZyZ2b1=_u6CCAA@mail.gmail.com>
Nice workaround idea, works! Thank you Mans.

p.s. Have no idea where the "confidential" thing came from, sorry.


On Fri, Jun 5, 2020 at 10:31 AM Måns Rullgård <[email protected]> wrote:

> Danijel DOMAZET <[email protected]> writes:
>
> > Hi list,
> >
> > I have a heavily "overflowed" WAV file (samples written in float 32-bit
> > format): instead of [-1.0,+1.0], the samples range goes as far as
> > [-5.0,+5.0].
> >
> > Using SoX to get raw PCM audio samples from WAV file:
> >
> > `sox --bits 32 --channels 1 --encoding floating-point --rate 48000
> > input.wav output.raw`
> >
> > I get warnings:
> >
> >     sox WARN sox: `input.wav' input clipped 1163400 samples
> >     sox WARN sox: `output.raw' output clipped 605664 samples; decrease
> > volume?
> >
> > When I look into the output, I see the samples were clipped, and the
> range
> > is [-1.0,+1.0] now. However, that is not what I want.
> >
> > I would like to have exactly the same output as input, just in different
> > format (RAW instead of WAV). Is there a way to prevent SoX from doing the
> > clipping?
>
> No, that isn't possible.  Sorry.
>
> In your specific case, however, a workaround is possible.  If you
> override input sample encoding as 32-bit signed integer instead of
> float, the values will be copied untouched.  Since the output is
> headerless, it doesn't matter what sox thinks the samples are.
>
> --
> Måns Rullgård
>

-- 
- Confidential -

_______________________________________________
Sox-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sox-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.