How to prevent sox changing metadata when duplicating a file?

88 Views Asked by At

My AIFF audio file contains metadata for loop points. When I duplicate the file using sox it alters the metadata.

$ soxi -V sample.aiff

soxi INFO formats: detected file format type `aiff'
soxi INFO aiff: AIFF Loop markers:
soxi INFO aiff: Loop 0: start:  75576
soxi INFO aiff:  end:   103868
soxi INFO aiff:  count:      1
soxi INFO aiff:  type:  
soxi INFO aiff: forward
soxi INFO aiff: Unity MIDI Note: 52
soxi INFO aiff: Low   MIDI Note: 50
soxi INFO aiff: High  MIDI Note: 53

Input File     : 'sample.aif'
Channels       : 1
Sample Rate    : 44100
Precision      : 24-bit
Duration       : 00:00:03.80 = 167665 samples = 285.145 CDDA sectors
File Size      : 507k
Bit Rate       : 1.07M
Sample Encoding: 24-bit Signed Integer PCM

$ sox sample.aif sampleCOPY.aif

$ soxi sampleCOPY.aif

soxi INFO formats: detected file format type `aiff'
soxi INFO aiff: AIFF Loop markers:
soxi INFO aiff: Loop 0: start:  75576
soxi INFO aiff:  end:    75576
soxi INFO aiff:  count:      1
soxi INFO aiff:  type:  
soxi INFO aiff: forward
soxi INFO aiff: Unity MIDI Note: 52
soxi INFO aiff: Low   MIDI Note: 50
soxi INFO aiff: High  MIDI Note: 53

Input File     : 'sampleCOPY.aif'
Channels       : 1
Sample Rate    : 44100
Precision      : 24-bit
Duration       : 00:00:03.80 = 167665 samples = 285.145 CDDA sectors
File Size      : 503k
Bit Rate       : 1.06M
Sample Encoding: 24-bit Signed Integer PCM

In the duplicated file:

  1. The loop end point has been changed to the same as the start point
  2. The duplicated file reports as 4k smaller

Note that the top half of the soxi output is the verbose content, if that makes any difference.

How do I ensure the metadata is kept intact when duplicating a file?

0

There are 0 best solutions below