This is a file that I’ve exported as “Other Uncompressed Format” MS ADPCM. The game engine we’re using currently uses this for streaming sources. Exporting causes some unusable distortion. I recently was going to purchase another program called twisted wave for this, he recently updated the library and it doesn’t cause distortion. What library is audacity using for MS ADPCM compression?
Considering that ADPCM is only a 4 bit format I think that sounds as good as can be expected. ADPCM is a very old compressed format that was developed for telephony, It still performs quite well for voice quality applications (though more recent formats such as Speex perform better) and is relatively easy to implement in hardware. For compressing music it has been superseded by “modern” formats such as MP3, OGG, WMA, AC3…
I’m not certain what library Audacity uses but I’d guess libsndfile.
I tested the on-line version of twisted wave and the MS ADPCM encoding is virtually identical to Audacity.
I’m not talking about overall sound quality, i’m talking about bursts of distortion. The old version of twistedwave gave me the exact issue, but he corrected. I believe the new library that he replaced it with is SoX or something. I think the libsnd is what he was using before.
I understand that MSADPCM sucks and that it’s not the ideal format for modern sound, however it is what the engine that we are using uses. It’s not the format that I would choose if I were working on it.
You mean the short bursts of noise, like at 2.169 to 2.218 seconds?
I don’t know what they are. I’ll see if I can reproduce the issue. It may help if you could post an uncompressed MS PCM WAV file version so I can test that.
I’m afraid my ears are too old to hear very subtle difference as those two files seem to have. I would find the Audacity file perfectly acceptable - it’s only in comparison to the twisted wave version that it sounds to me marginally less clean, plus perhaps it has an odd suspicion of masked crackle in the background.
If other than the places Steve mentioned, can you point to an exact timeline spot in the Audacity file to listen for?
Exactly what is your workflow to produce that file in Audacity? Are you mixing imported files together? Are any of the files offset from time zero?
Thanks for the reply Gale. It’s not a subtle difference in the compression that i’m talking about, i wouldn’t care about that, nor could my ears hear it either!
It’s actually the static crackles. If you listen from about 8 seconds on, you’ll hear some fairly consistent crackling. Especially after larger peaks.
All I’m doing with the files is making them in Logic and bouncing them as wav, then open in audacity and save as. Nothing is offset or anything like that.
Hey! That sounds pretty cool! Well, for an electronic glitch track maybe, but not for my current project. That is precisely the stuff i’m talking about.
Twisted wave switched to something else for the encoding, like i said earlier, i believe SoX which i think a lot of other programs are using as well, and the resulting file doesn’t have it. http://twistedwave.com/releasenotes.html
Audacity 2.0.3 changed to libsoxr for sample rate conversions - if that’s relevant here. If you only imported one file into a fresh, empty project there should not be any sample rate conversions because Audacity would import the file at the sample rate it had.
Yes even I can hear that but that is the difference between the two files isn’t it - if the Audacity and Twisted Wave encoding had been identical, the result would have been silence.
It isn’t what the Audacity file sounds like (on my Windows 7 machine).
To be clear, does the audio sound OK in Audacity before you export it?
Please look at Audacity > Preferences: Quality. Under “High-quality conversion”, what is “Dither” set to?
In what program do you play it and it sounds bad?
If the exported file sounds terrible like Robert’s file, can you record (as PCM WAV or PCM AIFF) a few seconds of the Audacity-exported file while it plays on Mac, then post that? You can use Soundflower and Audacity to record it, or other programs like Audio Hijack Pro.
To be clear, does the audio sound OK in Audacity before you export it?
Please look at Audacity > Preferences: Quality. Under “High-quality conversion”, what is “Dither” set to?
Dither is set to shaped.
The initial wav file sounds find when it is playing back in everything. When exported to MS ADPCM from audacity, it plays back poorly in every program. The crackles are written into the file, it’s not about playback or anything.
In what program do you play it and it sounds bad?
If the exported file sounds terrible like Robert’s file, can you record (as PCM WAV or PCM AIFF) a few seconds of the Audacity-exported file while it plays on Mac, then post that? You can use Soundflower and Audacity to record it, or other programs like Audio Hijack Pro.
The exported file doesn’t sound like Robert’s, he was illustrating the difference when they inverted, so doing a hijack type of situation wouldn’t really show anything different than you’ve already heard.
A problem that we are having is that we are not totally sure what problem you are talking about.
There is nothing in the Audacity recording that I would refer to as “distortion” (other than the expected sound quality degradation due to adpcm encoding), but I do notice that in the Audacity there are intermittent bursts of noise (not very loud, but noticeable).
Switching to the “Spectrogram View” these noise bursts are visible. For example, just before 9.5 seconds:
Assuming that this is the problem, I think that it may be to do with a compatibility issue, in that some applications require a small frame size for adpcm, and a small frame size can cause noise between adjacent frames. If this is the problem, then you can work around it by either, export with FFMpeg, or use SoX as an external encoder.
Using SoX as an external encoder - with SoX installed, the following command worked for me on Linux:
sox -t wav - -e ms-adpcm "%f"
This command may require tweaking for other platforms and other versions of SoX,
The noise bursts are what I’m talking about, they are very audible and they are not dithering distortion. The noise spikes that can be heard especially after a loud attack followed by less sound, you can hear crackles audibly.
I will try to download ffmpeg though i don’t think that it has ADPCM. In the SoX as external, is “%f” the file name?
Interesting. The NOISE BURSTS (clarifying that this was the initial problem) Do not seem to be happening when using ffmpegs codecs for wav ms adpcm. The dither however does seem to be a lot louder. I’m not sure if this is just a setting issue i’m having, or where to go from here.
To summarize what’s been happening so far:
Wav file authored in another program exported full pcm opened in audacity and twisted wave.
Twisted Wave: Sounds good (as adpcm can), no noise bursts
Audacity : Sounds the same as the twistedwave file, but with audible noise bursts and crackles
Audacity ffmpeg: Sounds substantially worse, but noise bursts are apparently gone
Ok, well I still have to use this shitty format, so no one really “wins” except for the lousy game engine, however using sox as an external encoder produces a file that is both the cleanest and without any of the noise bursts. I installed sox into my application directory and used command line and it is fairly straight forward.
WHEW.
Thank you all for your input, but as for right now, i think i can put this to rest. Please do not lock the topic just yet though.
Now that I know this is what I need to do, i want to set up a chain for it. When I select ExportWav in the commands menu, I can’t get access to any of the things that I would need to set it up and tell it to use the external encoder or really anything else. I’m not sure if writing anything into the parameters field would help at all, it doesn’t seem like it would.
Unfortunately “Export > external program” is not yet available in Chains.
If you have a lot of files to process I’d suggest that you export in ordinary (MS PCM) WAV format, and then use a batch script to use SoX for the conversion. I’ve no idea about AppleScript, but I think that bash (Unix shell) scripts work on a Mac so if you need help with this I can probably help you write a Bash script (or perhaps someone else can assist with AppleScript).
I tried a few different bash scripts but I got errors. I’ve no doubt they were user errors. What would be convenient is if I could set up the shell script in an Automator application and run that on a folder or something. I think I was missing some combo of -r (recursive) and some sort of variable placeholder for the file names. Also I was getting a permission denied script, presumably because I was probably trying to write a file to the wrong place. I know a bunch of bash commands but I’m not great at putting them together so if you had some advice on how to set up a repeatable action I’d greatly appreciate it.