Ar_e_en Posted August 28, 2022 I have a few sound effects that I'd like to add to a wad that I'm making, and I'd like to make sure that the quality of these sounds are as good as they can get! As an example: I have a MBF21 chaingun replacement that has a new sound effect. The source file for the sound effect is a stereo, 16 bit (little-endian) .wav file with a sample rate of 44100 Hz. Using ffmpeg - I made a mono, unsigned 8 bit, 22050 Hz copy of the file (I also added a few minor filters like a limiter and a fade out). Once I imported the file into SLADE (and converted it to the DOOM format) - the end result was actually pretty decent, however, when I use my chaingun replacement - I start hearing some clicks or pops between the gun shots. The best solution to this problem that I came up with was to go into my DeHackEd file and count up all the frame tic "Durations" between the code pointers that call on my new sound effect (combined value was 6 tics) and multiplying it with 28 milliseconds (which according to the DOOM wiki is the average millisecond value for one gametic). After trimming down my sound effect, applying the filters again and converting it into the DOOM format - the sound is better and there are no more distracting clicks and pops, but the sound effect no longer sounds as beefy as it used to (before the trimming - the effect had a longer and nicer fade out, but after the fix - it's no longer there and it feels a bit flat). I feel like there is still room for improvement and I have a few other sound effects that I'd like to add. The biggest obstacle in creating and converting these new sounds for me is the "unsigned 8 bit" parameter which tends to create a lot of crackles in the more silent parts of my sound effects. If you have any ways of improving the quality of newly added sound effects - let me know! 0 Quote Share this post Link to post
Lippeth Posted August 28, 2022 (edited) So, I'll preface this by saying I don't know anything about ffmpeg, so I may be misinterpreting the issue, but I downsample effects all the time to coexist with Doom's other sounds with Audacity and can relate to crackling and popping. My first guess is that by converting a stereo file to mono, it's summing the left and right channels together, and if the file isn't true stereo it will simply double in volume and cause it to clip. Depending on the audio editor you're using, you should be able to isolate each side and if both sound the same you can remove one and just use one channel. Also, if the source sound has a lot of low end it will clip and cause popping when downsampled. So an eq may be handy to process the sound before converting, and if you ever go as low as 11025 Hz, raising the high end can help retain what is lost by removing so many samples. But raising anything will also increase volume, which causes clipping. For that any brickwall limiter should work. Set the output of whatever limiter you're using to -0.1 and it should help avoid any unwanted signals. A good reference on what to avoid is Doomguy's death sound (DSPLDETH), as that showcases textbook popping due to digital clipping when downsampling. Changing the bit depth youself isn't entirely necessary because it will be automatically converted to 8-bit when converting to Doom format in Slade, so adding a 16-bit file to Slade is fine, but Audacity converts bit-depth and sample rates brilliantly without any extra tools, and if taking care with the processing, sounds can play back as clean as you intend, even in vanilla. Again, let me know if I'm misunderstanding your exact issue, and I hope this helps! Edited September 6, 2022 by Lippeth 1 Quote Share this post Link to post
ClumsyDoomer Posted August 28, 2022 (edited) ^ All of this and: Bit reduction causes aliasing, that could be the deal with the clicks. The subtle movements of the waveform, when bitcrushed, turn into a staircase kind of thing and may sound like nasty clicking and crackling. There are some sound design tools that are meant to reduce aliasing and improve the overall signal-noise ratio, like compression (not filesize compression, but dynamic range compression) and dithering. Also it's important to trim the sound by the zero points of the waveform, but honestly I've never done any actual sound design, only nerdy musical jams with complicated VST setups. Edited August 28, 2022 by ClumsyDoomer 1 Quote Share this post Link to post
Ar_e_en Posted September 5, 2022 Sorry for not replying in a while - I was busy some unrelated stuff. I tried adding some equalization and I looked into the compression option, but no luck on my end. I might still experiment with some other filter settings, but I think @ClumsyDoomer has a point - the clicks are due to the aliasing from the 8 bit conversion process. I might look into some anti-aliasing options, but I think that the conversion from SLADE will still screw this up. 0 Quote Share this post Link to post
Lippeth Posted September 5, 2022 Are you able to share the sounds in question, both the source and your processed version? I've never had (or at least never noticed) popping issues when lowering bit depth and converting to Doom format so now I'm wondering if I've just been extremely lucky with sound selection, or if I'm just deaf or subconsciously embrace the degradation. 1 Quote Share this post Link to post
Ar_e_en Posted September 6, 2022 I put together a .zip file with the sound effects. The filtered versions have the following ffmpeg effect added to them: -filter_complex alimiter=limit=0.7:attack=0.7:level=disabled There is always the chance that I've messed something up with the filter, however, these settings were the ones that gave the best results for me. GunSNDFX.zip 0 Quote Share this post Link to post
maxmanium Posted September 6, 2022 Whenever there's loud clicks and pops in a Doom sound effect, in my experience that means it's simply too loud and is clipping, and needs to be normalized. I just click normalize in audacity and it works. 1 Quote Share this post Link to post
Lippeth Posted September 6, 2022 After testing, I can confirm that the cause for popping in-game is the small amount of silence in the audio file, trimming off the beginning in an audio editor rather than DeHackEd should remove the pops in-game while retaining everything else. Here's a trimmed version for comparison's sake, and an eq'd version just for fun. GunSNDFX-lippeth.zip 1 Quote Share this post Link to post
Ar_e_en Posted September 8, 2022 On 9/6/2022 at 7:11 PM, Lippeth said: After testing, I can confirm that the cause for popping in-game is the small amount of silence in the audio file, trimming off the beginning in an audio editor rather than DeHackEd should remove the pops in-game while retaining everything else. I checked the versions you sent over and tried to remake them on my own end, and it worked! Thank you! Although, the weird thing is that I honestly never would have thought that cutting out the silence at the beginning would have stopped the clicks and pops (if anything - I thought that keeping the silence would have helped). 0 Quote Share this post Link to post
Lippeth Posted September 8, 2022 Yeah, I won't even pretend to know why that's the case, but I'm glad it works now. I even learned a few things in the process too, like exporting sounds to 8-bit before converting to Doom format makes them way less prone to clipping, which makes sense because lower bit depth = less headroom for dynamics so doing it while still working with the sound allows for better control rather than letting Slade automatically squash it, so thanks! 1 Quote Share this post Link to post
Ar_e_en Posted September 8, 2022 That is one thing I noticed while messing with the sound effects - SLADE will warn me about quality loss when I give it a 16 bit sound effect for the conversion, but if I give it an unsigned 8 bit sound - there's no warning! I think that there isn't really that big of a difference (if any) between an unsigned 8 bit .wav file and a "Doom format" sound lump, they are probably the same thing with maybe a very minuscule header change. 1 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.