I have a large number (248) of .PCM files encoded as:
16-bit signed PSM
With an 8-byte header (4 bytes identifying the file to the chip that plays it, and 4 bytes containing looping data)
I need to apply an amplification of -7.5 dB to all of them, then save the results in the same format (audacity outputs them as .raw, but simply renaming to .pcm gets them working with the chip).
I’ve more-or-less resigned myself to manually copy/pasting the header data in a hex editor for each file, but I was hoping I could automate the amplification.
From the research I’ve done, it seems that Audacity can handle batch-processing of files through “chains”, but I’ve run into a major hurdle before I can even begin trying to build a chain for for this.
To load the audio into Audacity before amplifying (deamplifying?) it, I have to “File → Import → Raw data”, and then manually set the encoding information. If I try to apply a chain (I tried the “mp3 conversion” that I’m guessing was automatically added when I installed the Lame for Audacity package), I get the error message that tells me that Audacity can’t load the file, try installing ffmpeg (already installed), or to use file → import → raw data for uncompressed audio.
So my question is simple, is there any way to setup a chain to process RAW PCM audio, giving the encoding needed to interpret the files in advance (since they’re all encoded the same)?
Ideally the chain would take all my files apply a -7.5 dB amplification, then save the results with the same filename as .raw. So if i input the file “ff3-1.pcm” it would output the file “ff3-1.raw” with the needed volume adjustments.
It would be amazing if there was also a way to preserve the first 8-bytes of data from the .PMC into the .RAW, but I can hex-edit that in if needed.