From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id DCE241F55B for ; Fri, 5 Jun 2020 08:40:13 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jh7tX-0006jg-N0; Fri, 05 Jun 2020 08:40:07 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jh7tW-0006jZ-NR for sox-users@lists.sourceforge.net; Fri, 05 Jun 2020 08:40:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YrOmPOd1KTMDXtsPgIFN9UDd1HqirsMZiucIMnRWKNw=; b=MtXqi/CgSx/OQ1f4kcoNt/bdp/ 4BoGszYiDFvePVmLEO2GTh34V0WrwJp9I6x9o135XdeVquEl8iDRcblKJOaemsF0BFv0xGYnVzRqa CRkwTnuiRAFujLoMTRcQ3/9Fv1iDq9BybS3WLKygfcE12Cm7XDzqb07a53SwLdgVdmU4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YrOmPOd1KTMDXtsPgIFN9UDd1HqirsMZiucIMnRWKNw=; b=TOIyLOp72HeAkWLqZ74+w4zCX1 G6sV1d4vqRgp7jJy2KvksLYYWWTw88JY5GTE+Ie3wOQIdpo/AZhgXsEAtc51QMucfcZOZPHY6S+f0 bPDFUpN1McH2MOBf8RJEsAl3lUng5gO5tvb8oQI7QOqK9IQSTkEoGieor6WISd9dWCpo=; Received: from mail-lj1-f171.google.com ([209.85.208.171]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1jh7tT-006eoV-Bc for sox-users@lists.sourceforge.net; Fri, 05 Jun 2020 08:40:06 +0000 Received: by mail-lj1-f171.google.com with SMTP id n23so10716575ljh.7 for ; Fri, 05 Jun 2020 01:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devialet.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YrOmPOd1KTMDXtsPgIFN9UDd1HqirsMZiucIMnRWKNw=; b=QCrNRXrm2YoE4JNbz8hs/hcOUn0SGHhvQcqgvLteUnrMxOOkSpyVsP97CFGv7T5DA8 jdARYpyTzn67Hev1HmWLPUpWmMagB6tOwN5kiZklZv5km0x6BJLv1mP2/Fugeg5YTCsk +wD+HqQFDCHPlJzyDdrpi5xaxS6GHPylnatLUCvD4IIWVcNVh4jeM/cdd2QhsYKlUXkk btVxgDxs+Nx3tyuJnNEmkmpJ0EUk45CDoA11yUsq8id0aSBe8XGaXuqJUyHjJxSuIQXr hn9ECDxiqaxyplOus8E4st7fnx+2gNph561WGtWVt4INbrm6lDLLm6+Ua+CZQiMsGixB Kajw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YrOmPOd1KTMDXtsPgIFN9UDd1HqirsMZiucIMnRWKNw=; b=NikrwXcOM+RAq+94zTSe+/iOe+ME0aSt2pw+HEeagMhfVfwuvTyvC2/8pIGeuKz8Fh 9du+FsP1yJjx60QCN0wMpypS3XRuNxq/bO6WFyzmD3ODaPEtwdAWSNITscjFqkzw+sWk aLEXS/9apGNEpvQm9H+N1UujCTcPaPPjLqhT0D1cOJ3LoIjBOr7T8fC5sWubcN1H8btR 7VD7CFpGY/It9zEeWs71naLjo9+aYMLONbraX1DbnKgTBwV24hGwGoVVjxB8JXJe5He0 IMP1Hcw19caLGebgswoXs0ULT2nQ0DuZW+TMAg8gDmAdZgDQ630YuK0dfhvFdrbrXSiF NF3Q== X-Gm-Message-State: AOAM532VIi2kUwDRuWfmCMwHlQoiuPVBkkwUumMRdqNae8WsHG4NtpXI v5K+XCKi00CHAWKl5wfrccGHXjriyvkSOsUYL17EW3LESd3QFctmpszyW2hTRODYk6CCB5NM1YI 7El9A1NWM4iqP3ZxSzYulLiI0iPFOUDSLbf1g0JK3 X-Google-Smtp-Source: ABdhPJxbQ2F1rfMRl1ADX3vM9LGEEMTYwDw1qIGUAfj8Sb9fgrQkRV4hlw311VZGZDKQsw2OnR23HAICgP8Sz+uqOHI= X-Received: by 2002:a2e:8347:: with SMTP id l7mr3013681ljh.182.1591346395852; Fri, 05 Jun 2020 01:39:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Danijel DOMAZET Date: Fri, 5 Jun 2020 10:39:19 +0200 Message-ID: To: =?UTF-8?B?TcOlbnMgUnVsbGfDpXJk?= X-Headers-End: 1jh7tT-006eoV-Bc Subject: Re: Prevent SoX from doing the clipping? X-BeenThere: sox-users@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sox-users@lists.sourceforge.net Cc: sox-users@lists.sourceforge.net Content-Type: multipart/mixed; boundary="===============5727620975146300995==" Errors-To: sox-users-bounces@lists.sourceforge.net --===============5727620975146300995== Content-Type: multipart/alternative; boundary="000000000000a3c5e105a7523403" --000000000000a3c5e105a7523403 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=C3=A5ns Rullg=C3=A5rd wr= ote: > Danijel DOMAZET 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 differen= t > > format (RAW instead of WAV). Is there a way to prevent SoX from doing t= he > > 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=C3=A5ns Rullg=C3=A5rd > --=20 - Confidential - --000000000000a3c5e105a7523403 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Nice workaround idea, works! Thank you Mans.=C2=A0

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


On Fri, Jun 5, 2= 020 at 10:31 AM M=C3=A5ns Rullg=C3=A5rd <mans@mansr.com> wrote:
Danijel DOMAZET <p-danijel.domazet@devialet.com> writes= :

> Hi list,
>
> I have a heavily "overflowed" WAV file (samples written in f= loat 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:
>
>=C2=A0 =C2=A0 =C2=A0sox WARN sox: `input.wav' input clipped 1163400= samples
>=C2=A0 =C2=A0 =C2=A0sox WARN sox: `output.raw' output clipped 60566= 4 samples; decrease
> volume?
>
> When I look into the output, I see the samples were clipped, and the r= ange
> 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 differe= nt
> format (RAW instead of WAV). Is there a way to prevent SoX from doing = the
> clipping?

No, that isn't possible.=C2=A0 Sorry.

In your specific case, however, a workaround is possible.=C2=A0 If you
override input sample encoding as 32-bit signed integer instead of
float, the values will be copied untouched.=C2=A0 Since the output is
headerless, it doesn't matter what sox thinks the samples are.

--
M=C3=A5ns Rullg=C3=A5rd

- Confidential -
--000000000000a3c5e105a7523403-- --===============5727620975146300995== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============5727620975146300995== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users --===============5727620975146300995==--