Re: SoX not handling WAVE file as expected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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@xxxxxxxxx> 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@xxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxx
> >> https://lists.sourceforge.net/lists/listinfo/sox-users
> >
> > _______________________________________________
> > Sox-users mailing list
> > Sox-users@xxxxxxxxxxxxxxxxxxxxx
> > https://lists.sourceforge.net/lists/listinfo/sox-users


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



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux