sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* help trying to diagnose 0 samples output problem with reverse
@ 2008-12-02 19:06 Michael Bolton
  2008-12-03 17:36 ` robs
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Bolton @ 2008-12-02 19:06 UTC (permalink / raw
  To: sox-users

I'm using SoX 14.0.0 on a CentOS release 4.5 (Final) machine and when I attempt to reverse an MP3 and write it as WAV, file, no samples are written.  The only thing in the output is a single WAV (RIFF) header.  When I try the command with MP3 -> MP3, I get the same behavior but with a single MP3 header in the output.

I tried the same thing on an Ubuntu 8.04.1 machine using the same version of SoX (14.0.0) with the same inputs and the WAV file is properly written.  It must be a difference between the two environments but I haven't been able to find from SoX or otherwise diagnose why no samples are written in one case but are in the other.

I've pasted the two test cases below (first is CentOS, second is Ubuntu for comparison).

Also is there a more effective way to truncate a file than using a "reverse trim NNN reverse" pipeline?




$ cat test.mp3 | sox -V4 -t mp3 - -t wav out.wav reverse
sox: SoX v14.0.0

Input File     : '-' (mp3)
Sample Size    : 16-bit (2 bytes)
Sample Encoding: MPEG audio (layer I, II or III)
Channels       : 2
Sample Rate    : 44100
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no

sox wav: Do not support MPEG audio (layer I, II or III) with 16-bit data.  Forcing to Signed.
sox wav: Writing Wave file: Microsoft PCM format, 2 channels, 44100 samp/sec
sox wav:         176400 byte/sec, 4 block align, 16 bits/samp

Output File    : 'out.wav'
Sample Size    : 16-bit (2 bytes)
Sample Encoding: signed (2's complement)
Channels       : 2
Sample Rate    : 44100
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no
Comment        : 'Processed by SoX'

sox sox: effects chain: input      44100Hz 2 channels 16 bits (multi)
sox sox: effects chain: reverse    44100Hz 2 channels 16 bits 
sox sox: effects chain: output     44100Hz 2 channels 16 bits (multi)
sox wav: Finished writing Wave file, 0 data bytes 0 samples
$ strings out.wav
RIFF$
WAVEfmt 
data
$ du -b out.wav 
44    out.wav
$ ldd /usr/local/bin/sox
    libsox.so.0 => /usr/local/lib/libsox.so.0 (0x0064e000)
    libsfx.so.0 => /usr/local/lib/libsfx.so.0 (0x003c4000)
    libmad.so.0 => /usr/local/lib/libmad.so.0 (0x002da000)
    libmp3lame.so.0 => /usr/local/lib/libmp3lame.so.0 (0x00e6e000)
    libm.so.6 => /lib/tls/libm.so.6 (0x00111000)
    libc.so.6 => /lib/tls/libc.so.6 (0x0019d000)
    /lib/ld-linux.so.2 (0x0017f000)

It was created by SoX configure 14.0.0, which was
generated by GNU Autoconf 2.61.  Invocation command line was

  $ ./configure --prefix=/usr/local --with-mad --with-lame








$ cat test.mp3 | sox -V4 -t mp3 - -t wav out.wav reverse 
sox: SoX v14.0.0

Input File     : '-' (mp3)
Sample Size    : 16-bit (2 bytes)
Sample Encoding: MPEG audio (layer I, II or III)
Channels       : 2
Sample Rate    : 44100
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no

sox wav: Do not support MPEG audio (layer I, II or III) with 16-bit data.  Forcing to Signed.
sox wav: Writing Wave file: Microsoft PCM format, 2 channels, 44100 samp/sec
sox wav:         176400 byte/sec, 4 block align, 16 bits/samp

Output File    : 'out.wav'
Sample Size    : 16-bit (2 bytes)
Sample Encoding: signed (2's complement)
Channels       : 2
Sample Rate    : 44100
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no
Comment        : 'Processed by SoX'

sox sox: effects chain: input      44100Hz 2 channels 16 bits (multi)
sox sox: effects chain: reverse    44100Hz 2 channels 16 bits 
sox sox: effects chain: output     44100Hz 2 channels 16 bits (multi)
sox wav: Finished writing Wave file, 45088768 data bytes 11272192 samples


      


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

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

* Re: help trying to diagnose 0 samples output problem with reverse
  2008-12-02 19:06 help trying to diagnose 0 samples output problem with reverse Michael Bolton
@ 2008-12-03 17:36 ` robs
  2008-12-04 18:53   ` Chris Bagwell
  0 siblings, 1 reply; 3+ messages in thread
From: robs @ 2008-12-03 17:36 UTC (permalink / raw
  To: sndprctst; +Cc: sox users list

--- On Tue, 2/12/08, Michael Bolton <sndprctst@yahoo.com> wrote:
> I'm using SoX 14.0.0 on a CentOS release 4.5 (Final)
> machine and when I attempt to reverse an MP3 and write it as
> WAV, file, no samples are written.  The only thing in the
> output is a single WAV (RIFF) header.

Weird.  It's obviously a bug, but I can't reproduce it here (with 14.0.0).  Maybe the bug has since been fixed---can you try 14.2.0?
If so, and you still see the problem do you see a similar problem if you replace the reverse effect with the norm effect?

> Also is there a more effective way to truncate a file than
> using a "reverse trim NNN reverse" pipeline?

With 14.2.0, there are a couple of other options, e.g.:
  sox infile outfile trim 0 0 NNNN
if the length of infile can be determined from its header, or
  sox infile outfile trim 0 LLLL NNNN
where LLLL is the length of the audio, determined perhaps using `stat'.

Hope this helps,
Rob


      

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

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

* Re: help trying to diagnose 0 samples output problem with reverse
  2008-12-03 17:36 ` robs
@ 2008-12-04 18:53   ` Chris Bagwell
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Bagwell @ 2008-12-04 18:53 UTC (permalink / raw
  To: aquegg, sox-users

robs wrote:
> --- On Tue, 2/12/08, Michael Bolton <sndprctst@yahoo.com> wrote:
>   
>> I'm using SoX 14.0.0 on a CentOS release 4.5 (Final)
>> machine and when I attempt to reverse an MP3 and write it as
>> WAV, file, no samples are written.  The only thing in the
>> output is a single WAV (RIFF) header.
>>     
>
> Weird.  It's obviously a bug, but I can't reproduce it here (with 14.0.0).  Maybe the bug has since been fixed---can you try 14.2.0?
> If so, and you still see the problem do you see a similar problem if you replace the reverse effect with the norm effect?
>   
My only guess is to check /tmp has enough disk space to handle to store 
a temporary file that is at least 2 times the size of the uncompressed 
WAV file and that local directory has enough space to store WAV file.  
There is a comment in 14.1.0 ChangeLog that says something about fixing 
ungraceful handling of out of disk space.  That would explain why no 
error messages printed.

>   
>> Also is there a more effective way to truncate a file than
>> using a "reverse trim NNN reverse" pipeline?
>>     
>
> With 14.2.0, there are a couple of other options, e.g.:
>   sox infile outfile trim 0 0 NNNN
> if the length of infile can be determined from its header, or
>   sox infile outfile trim 0 LLLL NNNN
> where LLLL is the length of the audio, determined perhaps using `stat'.
>
>   
First option is the best and 2nd option is pretty good because its 
scanning over audio in a format much more compact then "reverse" does.  
Here is a 3rd option that may or may not be faster then the second 
option above.  With 14.2.0, if you know that all your audio files will 
be at least some minimum size then you can copy over that amount before 
performing reverse and so not have to unreverse so much of the audio 
file.  For example, if audio will always be at least 1 minute:

sox infile.mp3 out.wav trim 0 1:00 : reverse trim NNN reverse

Chris

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

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

end of thread, other threads:[~2008-12-04 18:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-02 19:06 help trying to diagnose 0 samples output problem with reverse Michael Bolton
2008-12-03 17:36 ` robs
2008-12-04 18:53   ` Chris Bagwell

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).