0

I have a large number of .PCM files (248 total) that are all encoded as:

  • Encoding: Signed 16-bit uncompressed PCM
  • Byte order: Little-endian
  • Channels: 2 channel (stereo)
  • Sample rate: 44100 Hz
  • 8 Byte header

I need to apply a -7.5 db amplification (deamplification?) to every single one of these files.

The problem I have is that all of these tracks are looped, and I need to preserve the loop data (contained in the 8-byte header).

I've yet to see a batch audio editing problem that sox couldn't handle, so I'm hoping someone on here would know how to use sox to accomplish this, or failing that, know of a program that can do this for me.

Thanks for the help!


*Edit- A bit of research got me the exact encoding of the PCM audio I need to edit:

"The audio tracks are 44.1 kilohertz, 16-bit stereo uncompressed unsigned PCM files in little-endian order, left channel first, with a simple eight-byte header. The first four bytes spell out “MSU1” in ASCII. This is followed by a 32-bit unsigned integer used as the loop point, measured in samples (a sample being four bytes) – if the repeat bit is set in the audio state register, this value is used to determine where to seek the audio track to."


*Edit2-I've managed to develop the needed sox command, I just have no idea how to turn it into a batch. Also, turns out the files were 16-bit signed, not unsigned, PCM.

sox -t raw -e signed -b 16 -r 44100 -c 2 -L [filename].pcm -t raw -L [filename].raw vol -7.5dB

I'm fine with either a .BAT I drag and drop files onto or a .BAT that just converts every .PCM file in the folder.

Help appreciated, because I don't even know where to start looking for this one...

edale
  • 31
  • 3
  • Do you have a code? – Ibo Oct 03 '17 at 03:32
  • @Ibo I'm not sure what you mean by code? If you mean sox command, theoretically "vol -7.5dB" should be the command I need, but so far all my attempts to do this (or make any change, no matter how minor) with sox results in massively distorted audio. – edale Oct 04 '17 at 04:47
  • OK, turns out the PCM was signed, not unsigned. This code will do the audio reduction I need (though I'll need to hex-edit the header data back in manually): --- sox -t raw -e signed -b 16 -r 44100 -c 2 -L [filename].pcm -t raw -L [filename].raw vol -7.5dB ---- Now I just need to turn it into a batch file... – edale Oct 04 '17 at 05:07
  • This thing will not let me format the comments in any way shape or form... next post is the code needed and nothing else. – edale Oct 04 '17 at 05:13
  • sox -t raw -e signed -b 16 -r 44100 -c 2 -L [filename].pcm -t raw -L [filename].raw vol -7.5dB – edale Oct 04 '17 at 05:14
  • Can anyone turn that into a batch for me? I have no clue how. – edale Oct 04 '17 at 05:15

0 Answers0