sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* SoX not handling WAVE file as expected
@ 2021-10-06  6:50 Lee Jones
  2021-10-06 12:11 ` Jeff Learman
  2021-10-07 12:08 ` Jeremy Nicoll - ml sox users
  0 siblings, 2 replies; 13+ messages in thread
From: Lee Jones @ 2021-10-06  6:50 UTC (permalink / raw)
  To: sox-users

It's almost certainly my fault, but I'm perplexed as to how to fix it.

> # File type looks like a standard WAV(E) file
> ljkenny:~$ file manchester_app_test.wav
> manchester_app_test.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 48000 Hz
>
> # SoX status reports file as being 0 seconds (it's actually 1:10hrs long.
> ljkenny:~$ sox manchester_app_test.wav -n stat
> Samples read:                 0
> Length (seconds):      0.000000
> Scaled by:         2147483647.0
> Maximum amplitude:     0.000000
> Minimum amplitude:     0.000000
> Midline amplitude:     0.000000
> Mean    norm:              -nan
> Mean    amplitude:         -nan
> RMS     amplitude:         -nan
> Maximum delta:         0.000000
> Minimum delta:         0.000000
> Mean    delta:        -0.000000
> RMS     delta:        -0.000000
> Rough   frequency:  -2147483648
>
> Probably text, not sound
>
> # Trimming all silence to 2 seconds
> ljkenny:~$ sox -V manchester_app_test.wav manchester_app_test-trimmed.wav silence -l 1 0.1 1% -1 2.0 1%
> sox:      SoX v14.4.2
> sox INFO formats: detected file format type `wav'
>
> Input File     : 'manchester_app_test.wav'
> Channels       : 2
> Sample Rate    : 48000
> Precision      : 16-bit# File type looks like a standard WAV(E) file
> ljkenny:~$ file manchester_app_test.wav
> manchester_app_test.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 48000 Hz
>
> # SoX status reports file as being 0 seconds (it's actually 1:10hrs long.
> ljkenny:~$ sox manchester_app_test.wav -n stat
> Samples read:                 0
> Length (seconds):      0.000000
> Scaled by:         2147483647.0
> Maximum amplitude:     0.000000
> Minimum amplitude:     0.000000
> Midline amplitude:     0.000000
> Mean    norm:              -nan
> Mean    amplitude:         -nan
> RMS     amplitude:         -nan
> Maximum delta:         0.000000
> Minimum delta:         0.000000
> Mean    delta:        -0.000000
> RMS     delta:        -0.000000
> Rough   frequency:  -2147483648
>
> Probably text, not sound
>
> # Trimming all silence to 2 seconds
> ljkenny:~$ sox -V manchester_app_test.wav manchester_app_test-trimmed.wav silence -l 1 0.1 1% -1 2.0 1%
> sox:      SoX v14.4.2
> sox INFO formats: detected file format type `wav'
>
> Input File     : 'manchester_app_test.wav'
> Channels       : 2
> Sample Rate    : 48000
> Precision      : 16-bit
> Sample Encoding: 16-bit Signed Integer PCM
> Endian Type    : little
> Reverse Nibbles: no
> Reverse Bits   : no
>
> sox INFO sox: Overwriting `manchester_app_test-trimmed.wav'
>
> Output File    : 'manchester_app_test-trimmed.wav'
> Channels       : 2
> Sample Rate    : 48000
> Precision      : 16-bit
> Sample Encoding: 16-bit Signed Integer PCM
> Endian Type    : little
> Reverse Nibbles: no
> Reverse Bits   : no
> Comment        : 'Processed by SoX'
>
> sox INFO sox: effects chain: input        48000Hz  2 channels
> sox INFO sox: effects chain: silence      48000Hz  2 channels
> sox INFO sox: effects chain: output       48000Hz  2 channels
>
> # Output file is 44 Byes.
> ljkenny:~$ ls -lh manchester_app_test*
> -rw-r----- 1 joneslee primarygroup   44 Oct  6 07:41 manchester_app_test-trimmed.wav
> -rw-r----- 1 joneslee primarygroup 762M Oct  5 19:14 manchester_app_test.wav
> Sample Encoding: 16-bit Signed Integer PCM
> Endian Type    : little
> Reverse Nibbles: no
> Reverse Bits   : no
>
> sox INFO sox: Overwriting `manchester_app_test-trimmed.wav'
>
> Output File    : 'manchester_app_test-trimmed.wav'
> Channels       : 2
> Sample Rate    : 48000
> Precision      : 16-bit
> Sample Encoding: 16-bit Signed Integer PCM
> Endian Type    : little
> Reverse Nibbles: no
> Reverse Bits   : no
> Comment        : 'Processed by SoX'
>
> sox INFO sox: effects chain: input        48000Hz  2 channels
> sox INFO sox: effects chain: silence      48000Hz  2 channels
> sox INFO sox: effects chain: output       48000Hz  2 channels
>
> # Output file is 44 Byes.
> ljkenny:~$ ls -lh manchester_app_test*
> -rw-r----- 1 joneslee primarygroup   44 Oct  6 07:41 manchester_app_test-trimmed.wav
> -rw-r----- 1 joneslee primarygroup 762M Oct  5 19:14 manchester_app_test.wav

Any help would be gratefully received.


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: SoX not handling WAVE file as expected
  2021-10-06  6:50 SoX not handling WAVE file as expected Lee Jones
@ 2021-10-06 12:11 ` Jeff Learman
  2021-10-06 12:45   ` Lee Jones
  2021-10-07 12:08 ` Jeremy Nicoll - ml sox users
  1 sibling, 1 reply; 13+ messages in thread
From: Jeff Learman @ 2021-10-06 12:11 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 4976 bytes --]

Most likely the headers are incorrect.  Hex-dump the beginning of the file
and see how it looks given this format:
http://soundfile.sapp.org/doc/WaveFormat/

My guess is that the DATA chunk header has a zero length.  If so, it's
easily fixed using a hex editor.


On Wed, 6 Oct 2021 at 02:51, Lee Jones <ljkenny@gmail.com> wrote:

> It's almost certainly my fault, but I'm perplexed as to how to fix it.
>
> > # File type looks like a standard WAV(E) file
> > ljkenny:~$ file manchester_app_test.wav
> > manchester_app_test.wav: RIFF (little-endian) data, WAVE audio,
> Microsoft PCM, 16 bit, stereo 48000 Hz
> >
> > # SoX status reports file as being 0 seconds (it's actually 1:10hrs long.
> > ljkenny:~$ sox manchester_app_test.wav -n stat
> > Samples read:                 0
> > Length (seconds):      0.000000
> > Scaled by:         2147483647.0
> > Maximum amplitude:     0.000000
> > Minimum amplitude:     0.000000
> > Midline amplitude:     0.000000
> > Mean    norm:              -nan
> > Mean    amplitude:         -nan
> > RMS     amplitude:         -nan
> > Maximum delta:         0.000000
> > Minimum delta:         0.000000
> > Mean    delta:        -0.000000
> > RMS     delta:        -0.000000
> > Rough   frequency:  -2147483648
> >
> > Probably text, not sound
> >
> > # Trimming all silence to 2 seconds
> > ljkenny:~$ sox -V manchester_app_test.wav
> manchester_app_test-trimmed.wav silence -l 1 0.1 1% -1 2.0 1%
> > sox:      SoX v14.4.2
> > sox INFO formats: detected file format type `wav'
> >
> > Input File     : 'manchester_app_test.wav'
> > Channels       : 2
> > Sample Rate    : 48000
> > Precision      : 16-bit# File type looks like a standard WAV(E) file
> > ljkenny:~$ file manchester_app_test.wav
> > manchester_app_test.wav: RIFF (little-endian) data, WAVE audio,
> Microsoft PCM, 16 bit, stereo 48000 Hz
> >
> > # SoX status reports file as being 0 seconds (it's actually 1:10hrs long.
> > ljkenny:~$ sox manchester_app_test.wav -n stat
> > Samples read:                 0
> > Length (seconds):      0.000000
> > Scaled by:         2147483647.0
> > Maximum amplitude:     0.000000
> > Minimum amplitude:     0.000000
> > Midline amplitude:     0.000000
> > Mean    norm:              -nan
> > Mean    amplitude:         -nan
> > RMS     amplitude:         -nan
> > Maximum delta:         0.000000
> > Minimum delta:         0.000000
> > Mean    delta:        -0.000000
> > RMS     delta:        -0.000000
> > Rough   frequency:  -2147483648
> >
> > Probably text, not sound
> >
> > # Trimming all silence to 2 seconds
> > ljkenny:~$ sox -V manchester_app_test.wav
> manchester_app_test-trimmed.wav silence -l 1 0.1 1% -1 2.0 1%
> > sox:      SoX v14.4.2
> > sox INFO formats: detected file format type `wav'
> >
> > Input File     : 'manchester_app_test.wav'
> > Channels       : 2
> > Sample Rate    : 48000
> > Precision      : 16-bit
> > Sample Encoding: 16-bit Signed Integer PCM
> > Endian Type    : little
> > Reverse Nibbles: no
> > Reverse Bits   : no
> >
> > sox INFO sox: Overwriting `manchester_app_test-trimmed.wav'
> >
> > Output File    : 'manchester_app_test-trimmed.wav'
> > Channels       : 2
> > Sample Rate    : 48000
> > Precision      : 16-bit
> > Sample Encoding: 16-bit Signed Integer PCM
> > Endian Type    : little
> > Reverse Nibbles: no
> > Reverse Bits   : no
> > Comment        : 'Processed by SoX'
> >
> > sox INFO sox: effects chain: input        48000Hz  2 channels
> > sox INFO sox: effects chain: silence      48000Hz  2 channels
> > sox INFO sox: effects chain: output       48000Hz  2 channels
> >
> > # Output file is 44 Byes.
> > ljkenny:~$ ls -lh manchester_app_test*
> > -rw-r----- 1 joneslee primarygroup   44 Oct  6 07:41
> manchester_app_test-trimmed.wav
> > -rw-r----- 1 joneslee primarygroup 762M Oct  5 19:14
> manchester_app_test.wav
> > Sample Encoding: 16-bit Signed Integer PCM
> > Endian Type    : little
> > Reverse Nibbles: no
> > Reverse Bits   : no
> >
> > sox INFO sox: Overwriting `manchester_app_test-trimmed.wav'
> >
> > Output File    : 'manchester_app_test-trimmed.wav'
> > Channels       : 2
> > Sample Rate    : 48000
> > Precision      : 16-bit
> > Sample Encoding: 16-bit Signed Integer PCM
> > Endian Type    : little
> > Reverse Nibbles: no
> > Reverse Bits   : no
> > Comment        : 'Processed by SoX'
> >
> > sox INFO sox: effects chain: input        48000Hz  2 channels
> > sox INFO sox: effects chain: silence      48000Hz  2 channels
> > sox INFO sox: effects chain: output       48000Hz  2 channels
> >
> > # Output file is 44 Byes.
> > ljkenny:~$ ls -lh manchester_app_test*
> > -rw-r----- 1 joneslee primarygroup   44 Oct  6 07:41
> manchester_app_test-trimmed.wav
> > -rw-r----- 1 joneslee primarygroup 762M Oct  5 19:14
> manchester_app_test.wav
>
> Any help would be gratefully received.
>
>
> _______________________________________________
> Sox-users mailing list
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
>

[-- Attachment #1.2: Type: text/html, Size: 6577 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: SoX not handling WAVE file as expected
  2021-10-06 12:11 ` Jeff Learman
@ 2021-10-06 12:45   ` Lee Jones
  2021-10-06 12:53     ` Lee Jones
  0 siblings, 1 reply; 13+ messages in thread
From: Lee Jones @ 2021-10-06 12:45 UTC (permalink / raw)
  To: sox-users

Ah you're right.

> 00000000  52 49 46 46 00 00 00 00  57 41 56 45 66 6d 74 20  |RIFF....WAVEfmt |

I'll try to hack the file and see what happens.

Thanks.

On Wed, 6 Oct 2021 at 13:12, Jeff Learman <jjlearman@gmail.com> wrote:
>
> Most likely the headers are incorrect.  Hex-dump the beginning of the file and see how it looks given this format: http://soundfile.sapp.org/doc/WaveFormat/
>
> My guess is that the DATA chunk header has a zero length.  If so, it's easily fixed using a hex editor.
>
>
> On Wed, 6 Oct 2021 at 02:51, Lee Jones <ljkenny@gmail.com> wrote:
>>
>> It's almost certainly my fault, but I'm perplexed as to how to fix it.
>>
>> > # File type looks like a standard WAV(E) file
>> > ljkenny:~$ file manchester_app_test.wav
>> > manchester_app_test.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 48000 Hz
>> >
>> > # SoX status reports file as being 0 seconds (it's actually 1:10hrs long.
>> > ljkenny:~$ sox manchester_app_test.wav -n stat
>> > Samples read:                 0
>> > Length (seconds):      0.000000
>> > Scaled by:         2147483647.0
>> > Maximum amplitude:     0.000000
>> > Minimum amplitude:     0.000000
>> > Midline amplitude:     0.000000
>> > Mean    norm:              -nan
>> > Mean    amplitude:         -nan
>> > RMS     amplitude:         -nan
>> > Maximum delta:         0.000000
>> > Minimum delta:         0.000000
>> > Mean    delta:        -0.000000
>> > RMS     delta:        -0.000000
>> > Rough   frequency:  -2147483648
>> >
>> > Probably text, not sound
>> >
>> > # Trimming all silence to 2 seconds
>> > ljkenny:~$ sox -V manchester_app_test.wav manchester_app_test-trimmed.wav silence -l 1 0.1 1% -1 2.0 1%
>> > sox:      SoX v14.4.2
>> > sox INFO formats: detected file format type `wav'
>> >
>> > Input File     : 'manchester_app_test.wav'
>> > Channels       : 2
>> > Sample Rate    : 48000
>> > Precision      : 16-bit# File type looks like a standard WAV(E) file
>> > ljkenny:~$ file manchester_app_test.wav
>> > manchester_app_test.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 48000 Hz
>> >
>> > # SoX status reports file as being 0 seconds (it's actually 1:10hrs long.
>> > ljkenny:~$ sox manchester_app_test.wav -n stat
>> > Samples read:                 0
>> > Length (seconds):      0.000000
>> > Scaled by:         2147483647.0
>> > Maximum amplitude:     0.000000
>> > Minimum amplitude:     0.000000
>> > Midline amplitude:     0.000000
>> > Mean    norm:              -nan
>> > Mean    amplitude:         -nan
>> > RMS     amplitude:         -nan
>> > Maximum delta:         0.000000
>> > Minimum delta:         0.000000
>> > Mean    delta:        -0.000000
>> > RMS     delta:        -0.000000
>> > Rough   frequency:  -2147483648
>> >
>> > Probably text, not sound
>> >
>> > # Trimming all silence to 2 seconds
>> > ljkenny:~$ sox -V manchester_app_test.wav manchester_app_test-trimmed.wav silence -l 1 0.1 1% -1 2.0 1%
>> > sox:      SoX v14.4.2
>> > sox INFO formats: detected file format type `wav'
>> >
>> > Input File     : 'manchester_app_test.wav'
>> > Channels       : 2
>> > Sample Rate    : 48000
>> > Precision      : 16-bit
>> > Sample Encoding: 16-bit Signed Integer PCM
>> > Endian Type    : little
>> > Reverse Nibbles: no
>> > Reverse Bits   : no
>> >
>> > sox INFO sox: Overwriting `manchester_app_test-trimmed.wav'
>> >
>> > Output File    : 'manchester_app_test-trimmed.wav'
>> > Channels       : 2
>> > Sample Rate    : 48000
>> > Precision      : 16-bit
>> > Sample Encoding: 16-bit Signed Integer PCM
>> > Endian Type    : little
>> > Reverse Nibbles: no
>> > Reverse Bits   : no
>> > Comment        : 'Processed by SoX'
>> >
>> > sox INFO sox: effects chain: input        48000Hz  2 channels
>> > sox INFO sox: effects chain: silence      48000Hz  2 channels
>> > sox INFO sox: effects chain: output       48000Hz  2 channels
>> >
>> > # Output file is 44 Byes.
>> > ljkenny:~$ ls -lh manchester_app_test*
>> > -rw-r----- 1 joneslee primarygroup   44 Oct  6 07:41 manchester_app_test-trimmed.wav
>> > -rw-r----- 1 joneslee primarygroup 762M Oct  5 19:14 manchester_app_test.wav
>> > Sample Encoding: 16-bit Signed Integer PCM
>> > Endian Type    : little
>> > Reverse Nibbles: no
>> > Reverse Bits   : no
>> >
>> > sox INFO sox: Overwriting `manchester_app_test-trimmed.wav'
>> >
>> > Output File    : 'manchester_app_test-trimmed.wav'
>> > Channels       : 2
>> > Sample Rate    : 48000
>> > Precision      : 16-bit
>> > Sample Encoding: 16-bit Signed Integer PCM
>> > Endian Type    : little
>> > Reverse Nibbles: no
>> > Reverse Bits   : no
>> > Comment        : 'Processed by SoX'
>> >
>> > sox INFO sox: effects chain: input        48000Hz  2 channels
>> > sox INFO sox: effects chain: silence      48000Hz  2 channels
>> > sox INFO sox: effects chain: output       48000Hz  2 channels
>> >
>> > # Output file is 44 Byes.
>> > ljkenny:~$ ls -lh manchester_app_test*
>> > -rw-r----- 1 joneslee primarygroup   44 Oct  6 07:41 manchester_app_test-trimmed.wav
>> > -rw-r----- 1 joneslee primarygroup 762M Oct  5 19:14 manchester_app_test.wav
>>
>> Any help would be gratefully received.
>>
>>
>> _______________________________________________
>> Sox-users mailing list
>> Sox-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sox-users
>
> _______________________________________________
> Sox-users mailing list
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: SoX not handling WAVE file as expected
  2021-10-06 12:45   ` Lee Jones
@ 2021-10-06 12:53     ` Lee Jones
  2021-10-06 13:09       ` Lee Jones
  2021-10-06 14:37       ` Måns Rullgård
  0 siblings, 2 replies; 13+ messages in thread
From: Lee Jones @ 2021-10-06 12:53 UTC (permalink / raw)
  To: sox-users

Okay, I think I've figured it out.

The data size portion of a WAVE file only allows for 4GB samples.

The samples I'm working with are much larger than that.

On Wed, 6 Oct 2021 at 13:45, Lee Jones <ljkenny@gmail.com> wrote:
>
> Ah you're right.
>
> > 00000000  52 49 46 46 00 00 00 00  57 41 56 45 66 6d 74 20  |RIFF....WAVEfmt |
>
> I'll try to hack the file and see what happens.
>
> Thanks.
>
> On Wed, 6 Oct 2021 at 13:12, Jeff Learman <jjlearman@gmail.com> wrote:
> >
> > Most likely the headers are incorrect.  Hex-dump the beginning of the file and see how it looks given this format: http://soundfile.sapp.org/doc/WaveFormat/
> >
> > My guess is that the DATA chunk header has a zero length.  If so, it's easily fixed using a hex editor.
> >
> >
> > On Wed, 6 Oct 2021 at 02:51, Lee Jones <ljkenny@gmail.com> wrote:
> >>
> >> It's almost certainly my fault, but I'm perplexed as to how to fix it.
> >>
> >> > # File type looks like a standard WAV(E) file
> >> > ljkenny:~$ file manchester_app_test.wav
> >> > manchester_app_test.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 48000 Hz
> >> >
> >> > # SoX status reports file as being 0 seconds (it's actually 1:10hrs long.
> >> > ljkenny:~$ sox manchester_app_test.wav -n stat
> >> > Samples read:                 0
> >> > Length (seconds):      0.000000
> >> > Scaled by:         2147483647.0
> >> > Maximum amplitude:     0.000000
> >> > Minimum amplitude:     0.000000
> >> > Midline amplitude:     0.000000
> >> > Mean    norm:              -nan
> >> > Mean    amplitude:         -nan
> >> > RMS     amplitude:         -nan
> >> > Maximum delta:         0.000000
> >> > Minimum delta:         0.000000
> >> > Mean    delta:        -0.000000
> >> > RMS     delta:        -0.000000
> >> > Rough   frequency:  -2147483648
> >> >
> >> > Probably text, not sound
> >> >
> >> > # Trimming all silence to 2 seconds
> >> > ljkenny:~$ sox -V manchester_app_test.wav manchester_app_test-trimmed.wav silence -l 1 0.1 1% -1 2.0 1%
> >> > sox:      SoX v14.4.2
> >> > sox INFO formats: detected file format type `wav'
> >> >
> >> > Input File     : 'manchester_app_test.wav'
> >> > Channels       : 2
> >> > Sample Rate    : 48000
> >> > Precision      : 16-bit# File type looks like a standard WAV(E) file
> >> > ljkenny:~$ file manchester_app_test.wav
> >> > manchester_app_test.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 48000 Hz
> >> >
> >> > # SoX status reports file as being 0 seconds (it's actually 1:10hrs long.
> >> > ljkenny:~$ sox manchester_app_test.wav -n stat
> >> > Samples read:                 0
> >> > Length (seconds):      0.000000
> >> > Scaled by:         2147483647.0
> >> > Maximum amplitude:     0.000000
> >> > Minimum amplitude:     0.000000
> >> > Midline amplitude:     0.000000
> >> > Mean    norm:              -nan
> >> > Mean    amplitude:         -nan
> >> > RMS     amplitude:         -nan
> >> > Maximum delta:         0.000000
> >> > Minimum delta:         0.000000
> >> > Mean    delta:        -0.000000
> >> > RMS     delta:        -0.000000
> >> > Rough   frequency:  -2147483648
> >> >
> >> > Probably text, not sound
> >> >
> >> > # Trimming all silence to 2 seconds
> >> > ljkenny:~$ sox -V manchester_app_test.wav manchester_app_test-trimmed.wav silence -l 1 0.1 1% -1 2.0 1%
> >> > sox:      SoX v14.4.2
> >> > sox INFO formats: detected file format type `wav'
> >> >
> >> > Input File     : 'manchester_app_test.wav'
> >> > Channels       : 2
> >> > Sample Rate    : 48000
> >> > Precision      : 16-bit
> >> > Sample Encoding: 16-bit Signed Integer PCM
> >> > Endian Type    : little
> >> > Reverse Nibbles: no
> >> > Reverse Bits   : no
> >> >
> >> > sox INFO sox: Overwriting `manchester_app_test-trimmed.wav'
> >> >
> >> > Output File    : 'manchester_app_test-trimmed.wav'
> >> > Channels       : 2
> >> > Sample Rate    : 48000
> >> > Precision      : 16-bit
> >> > Sample Encoding: 16-bit Signed Integer PCM
> >> > Endian Type    : little
> >> > Reverse Nibbles: no
> >> > Reverse Bits   : no
> >> > Comment        : 'Processed by SoX'
> >> >
> >> > sox INFO sox: effects chain: input        48000Hz  2 channels
> >> > sox INFO sox: effects chain: silence      48000Hz  2 channels
> >> > sox INFO sox: effects chain: output       48000Hz  2 channels
> >> >
> >> > # Output file is 44 Byes.
> >> > ljkenny:~$ ls -lh manchester_app_test*
> >> > -rw-r----- 1 joneslee primarygroup   44 Oct  6 07:41 manchester_app_test-trimmed.wav
> >> > -rw-r----- 1 joneslee primarygroup 762M Oct  5 19:14 manchester_app_test.wav
> >> > Sample Encoding: 16-bit Signed Integer PCM
> >> > Endian Type    : little
> >> > Reverse Nibbles: no
> >> > Reverse Bits   : no
> >> >
> >> > sox INFO sox: Overwriting `manchester_app_test-trimmed.wav'
> >> >
> >> > Output File    : 'manchester_app_test-trimmed.wav'
> >> > Channels       : 2
> >> > Sample Rate    : 48000
> >> > Precision      : 16-bit
> >> > Sample Encoding: 16-bit Signed Integer PCM
> >> > Endian Type    : little
> >> > Reverse Nibbles: no
> >> > Reverse Bits   : no
> >> > Comment        : 'Processed by SoX'
> >> >
> >> > sox INFO sox: effects chain: input        48000Hz  2 channels
> >> > sox INFO sox: effects chain: silence      48000Hz  2 channels
> >> > sox INFO sox: effects chain: output       48000Hz  2 channels
> >> >
> >> > # Output file is 44 Byes.
> >> > ljkenny:~$ ls -lh manchester_app_test*
> >> > -rw-r----- 1 joneslee primarygroup   44 Oct  6 07:41 manchester_app_test-trimmed.wav
> >> > -rw-r----- 1 joneslee primarygroup 762M Oct  5 19:14 manchester_app_test.wav
> >>
> >> Any help would be gratefully received.
> >>
> >>
> >> _______________________________________________
> >> Sox-users mailing list
> >> Sox-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/sox-users
> >
> > _______________________________________________
> > Sox-users mailing list
> > Sox-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/sox-users


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: SoX not handling WAVE file as expected
  2021-10-06 12:53     ` Lee Jones
@ 2021-10-06 13:09       ` Lee Jones
  2021-10-06 14:37       ` Måns Rullgård
  1 sibling, 0 replies; 13+ messages in thread
From: Lee Jones @ 2021-10-06 13:09 UTC (permalink / raw)
  To: sox-users

Still not working, even with a smaller file unfortunately.

> # Smaller file (<4GB)
> ljkenny-l:~$ ls -l gqrx_20211006_081931_120250000.wav
> -rw-r-----  1 ljkenny primarygroup 413M Oct  6 09:57 gqrx_20211006_081931_120250000.wav
>
> # File and data look valid now
> ljkenny-l:~$ sox gqrx_20211006_081931_120250000.wav -n stat
> Samples read:         216458854
> Length (seconds):   2254.779729
> Scaled by:         2147483647.0
> Maximum amplitude:     0.053558
> Minimum amplitude:    -0.039337
> Midline amplitude:     0.007111
> Mean    norm:          0.000112
> Mean    amplitude:     0.000000
> RMS     amplitude:     0.000811
> Maximum delta:         0.013397
> Minimum delta:         0.000000
> Mean    delta:         0.000008
> RMS     delta:         0.000076
> Rough   frequency:          716
> Volume adjustment:       18.671
>
> # Trim silences down to 2 seconds
> ljkenny-l:~$ sox -V gqrx_20211006_081931_120250000.wav gqrx_20211006_081931_120250000-trim.wav silence -l 1 0.1 1% -1 2.0 1%
> sox:      SoX v14.4.2
> sox INFO formats: detected file format type `wav'
>
> Input File     : 'gqrx_20211006_081931_120250000.wav'
> Channels       : 2
> Sample Rate    : 48000
> Precision      : 16-bit
> Duration       : 00:37:34.78 = 108229427 samples ~ 169108 CDDA sectors
> File Size      : 433M
> Bit Rate       : 1.54M
> Sample Encoding: 16-bit Signed Integer PCM
> Endian Type    : little
> Reverse Nibbles: no
> Reverse Bits   : no
>
> sox INFO sox: Overwriting `gqrx_20211006_081931_120250000-trim.wav'
>
> Output File    : 'gqrx_20211006_081931_120250000-trim.wav'
> Channels       : 2
> Sample Rate    : 48000
> Precision      : 16-bit
> Sample Encoding: 16-bit Signed Integer PCM
> Endian Type    : little
> Reverse Nibbles: no
> Reverse Bits   : no
> Comment        : 'Processed by SoX'
>
> sox INFO sox: effects chain: input        48000Hz  2 channels
> sox INFO sox: effects chain: silence      48000Hz  2 channels
> sox INFO sox: effects chain: output       48000Hz  2 channels
>
> # Resultant file is 44 Bytes again and contains no audio samples
> ljkenny-l:~$ sox gqrx_20211006_081931_120250000-trim.wav -n stat
> Samples read:                 0
> Length (seconds):      0.000000
> Scaled by:         2147483647.0
> Maximum amplitude:     0.000000
> Minimum amplitude:     0.000000
> Midline amplitude:     0.000000
> Mean    norm:              -nan
> Mean    amplitude:         -nan
> RMS     amplitude:         -nan
> Maximum delta:         0.000000
> Minimum delta:         0.000000
> Mean    delta:        -0.000000
> RMS     delta:        -0.000000
> Rough   frequency:  -2147483648
>
> Probably text, not sound


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: SoX not handling WAVE file as expected
  2021-10-06 12:53     ` Lee Jones
  2021-10-06 13:09       ` Lee Jones
@ 2021-10-06 14:37       ` Måns Rullgård
  2021-10-06 14:44         ` Lee Jones
  1 sibling, 1 reply; 13+ messages in thread
From: Måns Rullgård @ 2021-10-06 14:37 UTC (permalink / raw)
  To: Lee Jones; +Cc: sox-users

Lee Jones <ljkenny@gmail.com> writes:

> Okay, I think I've figured it out.
>
> The data size portion of a WAVE file only allows for 4GB samples.
>
> The samples I'm working with are much larger than that.

Then you really shouldn't be using WAV format.

> On Wed, 6 Oct 2021 at 13:45, Lee Jones <ljkenny@gmail.com> wrote:
>>
>> Ah you're right.
>>
>> > 00000000  52 49 46 46 00 00 00 00  57 41 56 45 66 6d 74 20  |RIFF....WAVEfmt |
>>
>> I'll try to hack the file and see what happens.

You could also try using the --ignore-length command line option.

-- 
Måns Rullgård


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: SoX not handling WAVE file as expected
  2021-10-06 14:37       ` Måns Rullgård
@ 2021-10-06 14:44         ` Lee Jones
  2021-10-06 18:34           ` unsubscribing from the SOX-user-list Stefan Ludwig via Sox-users
  2021-10-07  7:46           ` SoX not handling WAVE file as expected Lee Jones
  0 siblings, 2 replies; 13+ messages in thread
From: Lee Jones @ 2021-10-06 14:44 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: sox-users

On Wed, 6 Oct 2021 at 15:37, Måns Rullgård <mans@mansr.com> wrote:

Ah, hello Måns.  Small world!

> > Okay, I think I've figured it out.
> >
> > The data size portion of a WAVE file only allows for 4GB samples.
> >
> > The samples I'm working with are much larger than that.
>
> Then you really shouldn't be using WAV format.

Not my choice I'm afraid.  It's the output format from gqrx.

> > On Wed, 6 Oct 2021 at 13:45, Lee Jones <ljkenny@gmail.com> wrote:
> >>
> >> Ah you're right.
> >>
> >> > 00000000  52 49 46 46 00 00 00 00  57 41 56 45 66 6d 74 20  |RIFF....WAVEfmt |
> >>
> >> I'll try to hack the file and see what happens.
>
> You could also try using the --ignore-length command line option.

I'll give it a go and report back.

Thanks.


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

* unsubscribing from the SOX-user-list
  2021-10-06 14:44         ` Lee Jones
@ 2021-10-06 18:34           ` Stefan Ludwig via Sox-users
  2021-10-06 21:27             ` Lee Jones
  2021-10-07  7:46           ` SoX not handling WAVE file as expected Lee Jones
  1 sibling, 1 reply; 13+ messages in thread
From: Stefan Ludwig via Sox-users @ 2021-10-06 18:34 UTC (permalink / raw)
  To: Lee Jones, Sox-users; +Cc: Stefan Ludwig

Hello,

How do I unsubscribe from the SOX-user-List?

best regards Stefan

Am 06.10.2021 um 16:44 schrieb Lee Jones:
> On Wed, 6 Oct 2021 at 15:37, Måns Rullgård <mans@mansr.com> wrote:
>
> Ah, hello Måns.  Small world!
>
>>> Okay, I think I've figured it out.
>>>
>>> The data size portion of a WAVE file only allows for 4GB samples.
>>>
>>> The samples I'm working with are much larger than that.
>> Then you really shouldn't be using WAV format.
> Not my choice I'm afraid.  It's the output format from gqrx.
>
>>> On Wed, 6 Oct 2021 at 13:45, Lee Jones <ljkenny@gmail.com> wrote:
>>>> Ah you're right.
>>>>
>>>>> 00000000  52 49 46 46 00 00 00 00  57 41 56 45 66 6d 74 20  |RIFF....WAVEfmt |
>>>> I'll try to hack the file and see what happens.
>> You could also try using the --ignore-length command line option.
> I'll give it a go and report back.
>
> Thanks.
>
>
> _______________________________________________
> Sox-users mailing list
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users



_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unsubscribing from the SOX-user-list
  2021-10-06 18:34           ` unsubscribing from the SOX-user-list Stefan Ludwig via Sox-users
@ 2021-10-06 21:27             ` Lee Jones
  0 siblings, 0 replies; 13+ messages in thread
From: Lee Jones @ 2021-10-06 21:27 UTC (permalink / raw)
  To: Stefan Ludwig; +Cc: Sox-users


[-- Attachment #1.1: Type: text/plain, Size: 1276 bytes --]

Link at the bottom of the email you quoted.

On Wed, 6 Oct 2021, 19:34 Stefan Ludwig, <dipl-ing.ludwig@mailbox.org>
wrote:

> Hello,
>
> How do I unsubscribe from the SOX-user-List?
>
> best regards Stefan
>
> Am 06.10.2021 um 16:44 schrieb Lee Jones:
> > On Wed, 6 Oct 2021 at 15:37, Måns Rullgård <mans@mansr.com> wrote:
> >
> > Ah, hello Måns.  Small world!
> >
> >>> Okay, I think I've figured it out.
> >>>
> >>> The data size portion of a WAVE file only allows for 4GB samples.
> >>>
> >>> The samples I'm working with are much larger than that.
> >> Then you really shouldn't be using WAV format.
> > Not my choice I'm afraid.  It's the output format from gqrx.
> >
> >>> On Wed, 6 Oct 2021 at 13:45, Lee Jones <ljkenny@gmail.com> wrote:
> >>>> Ah you're right.
> >>>>
> >>>>> 00000000  52 49 46 46 00 00 00 00  57 41 56 45 66 6d 74 20
> |RIFF....WAVEfmt |
> >>>> I'll try to hack the file and see what happens.
> >> You could also try using the --ignore-length command line option.
> > I'll give it a go and report back.
> >
> > Thanks.
> >
> >
> > _______________________________________________
> > Sox-users mailing list
> > Sox-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/sox-users
>
>

[-- Attachment #1.2: Type: text/html, Size: 2160 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: SoX not handling WAVE file as expected
  2021-10-06 14:44         ` Lee Jones
  2021-10-06 18:34           ` unsubscribing from the SOX-user-list Stefan Ludwig via Sox-users
@ 2021-10-07  7:46           ` Lee Jones
  2021-10-07 12:24             ` Måns Rullgård
  1 sibling, 1 reply; 13+ messages in thread
From: Lee Jones @ 2021-10-07  7:46 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 1390 bytes --]

> > >> I'll try to hack the file and see what happens.
> >
> > You could also try using the --ignore-length command line option.
>
> I'll give it a go and report back.

Didn't work, I'm afraid.  Still not sure what I'm missing.

$ sox -V --ignore-length gqrx_20211006_081931_120250000.wav
> gqrx_20211006_081931_120250000-trim.wav silence -l 1 0.1 1% -1 2.0 1%
> sox:      SoX v14.4.2
> sox INFO formats: detected file format type `wav'
>
> Input File     : 'gqrx_20211006_081931_120250000.wav'
> Channels       : 2
> Sample Rate    : 48000
> Precision      : 16-bit
> Sample Encoding: 16-bit Signed Integer PCM
> Endian Type    : little
> Reverse Nibbles: no
> Reverse Bits   : no
>
> sox INFO sox: Overwriting `gqrx_20211006_081931_120250000-trim.wav'
>
> Output File    : 'gqrx_20211006_081931_120250000-trim.wav'
> Channels       : 2
> Sample Rate    : 48000
> Precision      : 16-bit
> Sample Encoding: 16-bit Signed Integer PCM
> Endian Type    : little
> Reverse Nibbles: no
> Reverse Bits   : no
> Comment        : 'Processed by SoX'
>
> sox INFO sox: effects chain: input        48000Hz  2 channels
> sox INFO sox: effects chain: silence      48000Hz  2 channels
> sox INFO sox: effects chain: output       48000Hz  2 channels
> ljkenny:~$ ls -l gqrx_20211006_081931_120250000-trim.wav
>
 -rw-r----- 1 ljkenny primarygroup 44 Oct  7 08:43
> gqrx_20211006_081931_120250000-trim.wav

[-- Attachment #1.2: Type: text/html, Size: 1910 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: SoX not handling WAVE file as expected
  2021-10-06  6:50 SoX not handling WAVE file as expected Lee Jones
  2021-10-06 12:11 ` Jeff Learman
@ 2021-10-07 12:08 ` Jeremy Nicoll - ml sox users
  2021-10-07 13:00   ` Lee Jones
  1 sibling, 1 reply; 13+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2021-10-07 12:08 UTC (permalink / raw)
  To: sox-users

On 2021-10-06 07:50, Lee Jones wrote:
> It's almost certainly my fault, but I'm perplexed as to how to fix it.

I'm just guessing, but ...


>> # Trimming all silence to 2 seconds
>> ljkenny:~$ sox -V manchester_app_test.wav 
>> manchester_app_test-trimmed.wav silence -l 1 0.1 1% -1 2.0 1%

That effect: silence -l 1 0.1 1% -1 2.0 1%

has parameters  -l   then 1 0.1 1%  then others.   According to the 
manual:

    1   0.1  1%
    ^                  1 means trim audio from the start of the file 
until
                             it first finds non-silence

        ^^^            0.1 means the length of time that non-silence must 
be
                             detected for

             ^^        1% means the level sound must have to be treated 
as
                             non-silence

You possibly thought that the "0.1" meant 0.1 seconds.  It doesn't.  It
means 0.1 samples which seems to me to be meaningless and might cause
sox to think that non-silence is never detected.  In that situation I'd
suspect that sox would then "trim" away ALL the contents.



-- 
Jeremy Nicoll - my opinions are my own


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: SoX not handling WAVE file as expected
  2021-10-07  7:46           ` SoX not handling WAVE file as expected Lee Jones
@ 2021-10-07 12:24             ` Måns Rullgård
  0 siblings, 0 replies; 13+ messages in thread
From: Måns Rullgård @ 2021-10-07 12:24 UTC (permalink / raw)
  To: Lee Jones; +Cc: sox-users

Lee Jones <ljkenny@gmail.com> writes:

>> > >> I'll try to hack the file and see what happens.
>> >
>> > You could also try using the --ignore-length command line option.
>>
>> I'll give it a go and report back.
>
> Didn't work, I'm afraid.  Still not sure what I'm missing.

Exactly what version of sox are you using?  I recommend building it from
the master branch in git.  Distro builds are all over the place.

-- 
Måns Rullgård


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: SoX not handling WAVE file as expected
  2021-10-07 12:08 ` Jeremy Nicoll - ml sox users
@ 2021-10-07 13:00   ` Lee Jones
  0 siblings, 0 replies; 13+ messages in thread
From: Lee Jones @ 2021-10-07 13:00 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 2788 bytes --]

On Thu, 7 Oct 2021 at 13:32, Jeremy Nicoll - ml sox users <
jn.ml.sxu.88@wingsandbeaks.org.uk> wrote:

> On 2021-10-06 07:50, Lee Jones wrote:
> > It's almost certainly my fault, but I'm perplexed as to how to fix it.
>
> I'm just guessing, but ...
>
> >> # Trimming all silence to 2 seconds
> >> ljkenny:~$ sox -V manchester_app_test.wav
> >> manchester_app_test-trimmed.wav silence -l 1 0.1 1% -1 2.0 1%
>
> That effect: silence -l 1 0.1 1% -1 2.0 1%
>
> has parameters  -l   then 1 0.1 1%  then others.   According to the
> manual:
>
>     1   0.1  1%
>     ^                  1 means trim audio from the start of the file
> until
>                              it first finds non-silence
>
>         ^^^            0.1 means the length of time that non-silence must
> be
>                              detected for
>
>              ^^        1% means the level sound must have to be treated
> as
>                              non-silence
>
> You possibly thought that the "0.1" meant 0.1 seconds.  It doesn't.  It
> means 0.1 samples which seems to me to be meaningless and might cause
> sox to think that non-silence is never detected.  In that situation I'd
> suspect that sox would then "trim" away ALL the contents.
>

Thanks for your reply Jeremy.

I took that command from Example 6 here:
https://digitalcardboard.com/blog/2009/08/25/the-sox-of-silence/

In the opening paragraphs, it seems to suggest that if you use a decimal
value then SoX treats the value as seconds instead of samples.

Which seems to be backed-up by the man page:

       [[hours:]minutes:]seconds[.frac][t]
              A  specification  of `1:30.5' corresponds to one minute,
thirty and ½ seconds.  The t suffix is entirely op‐
              tional (however, see the silence effect for an exception).
Note that the component values do not have to be
              normalized;  e.g., `1:23:45', `83:45', `79:0285', `1:0:1425',
`1::1425' and `5025' all are legal and equiva‐
              lent to each other.

       sampless
              Specifies the number of samples directly, as in `8000s'.  For
large sample counts, e notation is  supported:
              `1.7e6s' is the same as `1700000s'.

Ah, but there is a cavat later in the same man page:

duration  is  a time specification with the peculiarity that a bare number
is interpreted as a sample count,
not as a number of seconds.  For specifying seconds, either use the t
suffix (as in `2t')  or  specify  min‐
utes, too (as in `0:02').


I tried these commands, both resulted in the same outcome (full header, no
data):

sox -V --ignore-length in.wav out.wav silence -l 1 0.1t 1% -1 2.0 1%
sox -V --ignore-length in.wav out.wav silence -l 1 0:0.1 1% -1 2.0 1%

[-- Attachment #1.2: Type: text/html, Size: 3886 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-10-07 13:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-06  6:50 SoX not handling WAVE file as expected Lee Jones
2021-10-06 12:11 ` Jeff Learman
2021-10-06 12:45   ` Lee Jones
2021-10-06 12:53     ` Lee Jones
2021-10-06 13:09       ` Lee Jones
2021-10-06 14:37       ` Måns Rullgård
2021-10-06 14:44         ` Lee Jones
2021-10-06 18:34           ` unsubscribing from the SOX-user-list Stefan Ludwig via Sox-users
2021-10-06 21:27             ` Lee Jones
2021-10-07  7:46           ` SoX not handling WAVE file as expected Lee Jones
2021-10-07 12:24             ` Måns Rullgård
2021-10-07 12:08 ` Jeremy Nicoll - ml sox users
2021-10-07 13:00   ` Lee Jones

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).