Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Looking for an Audio Converter that Limits File Size and Increases Amplitude (Read 3726 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Looking for an Audio Converter that Limits File Size and Increases Amplitude

I'm going to keep this thread as sequential as possible to increase understanding and therefore help you help me. If you want to skip the story, head to Section 2.

Section 1

I get WAV files of the Church Sermons from my church and bring it to home. My end goal? Upload to Bandcamp. Problem! 291 MB per file (must be WAV, AIFF, or FLAC). I prefer FLAC.

The WAV file is ready to be converted to FLAC but it is very quiet so, using Format Factory, I increase the volume to 999% (software limit) and continue with the conversion, doing math to calculate the highest bitrate possible that will still get me under or at 291 MB. Problem! File is way bigger than 291 MB! I remove the volume increase and it's a little bit lower but not by much.

Temporary solution! I convert the WAV to an MP3 with the same volume boost and then convert the MP3 to FLAC. Ok, it's solved, but the audio quality on some of them is very muffled and very poor. So, I've managed to increase the audio quality a bit, but I'm running into bigger WAVs and it's getting really hard.

Section 2

What I am looking for is an audio conversion software that will let me do the following in one fowl swoop!
  • Convert WAV to FLAC
  • Increase Volume
  • Set File Size Limit, so it's never above 291 MB

Thank you very much and Merry Christmas!

Statements
I've used fre:ac, Format Factory, and AVS products. I'm guessing my answer will be a command-line process in ffmpeg

Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #1
MP3 should be good enough, what compression settings are you using? If it's muffled, then maybe you're accidentally compressing to 32kbit or lower.

Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #2
As above, why flac rather than mp3 for this application? Flac is lossless so your effectively size limited by the length of each recording you're encoding whereas with mp3 you could sacrifice bitrate to bring your file sizes in as required. You prefer flac but if you need to compress to get file sizes down then lossy compression becomes your only option - or split files.

You could still convert the resultant mp3 to flac as before but why bother, you're not gaining anything?

Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #3
As above, why flac rather than mp3 for this application? Flac is lossless so your effectively size limited by the length of each recording you're encoding whereas with mp3 you could sacrifice bitrate to bring your file sizes in as required. You prefer flac but if you need to compress to get file sizes down then lossy compression becomes your only option - or split files.

You could still convert the resultant mp3 to flac as before but why bother, you're not gaining anything?
Read the original post more closely. mp3 is not an option.

OP should look into lossywav.

Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #4
How are you converting the original WAV to FLAC?  I wouldn't expect this process to reduce volume.

Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #5
File size - For uncompressed files, file size is simply the product of sample rate (kHz), bit depth (converted to bytes), number of channels, and the playing time.   As long as you know there at 8-bits in a byte, it's a straightforward calculation.     For example, CD audio is 44.1kHz, 16-bits, 2-channel stereo.   That's 44,100 samples per second x 2 bytes x 2 channels = 176,400 bytes per second, which works-out to about 10MB per minute.   A mono file will be half the size of a stereo file.  A 24-bit file is 50% bigger than a 16-bit file.  (An 8-Bit file would be half the size but probably unacceptable quality.)

A FLAC will be about 60% the size of the uncompressed original.    (You won't get as much compression with mono, but the mono starts-out smaller.)

Quote
I increase the volume to 999% (software limit)
I don't know what that means.   Most audio editors/tools (Audacity/GoldWave/Sox, etc.) have a normalize (maximize) function that adjusts the volume as high as possible without clipping  (distortion).     That's often not loud enough because one "loud peak" limits the volume of the entire program.  To get-around that, you can use limiting or dynamic compression to "push down" the peaks and then boost the overall volume.
 and continue with the conversion, doing math to calculate the highest bitrate possible that will still get me under or at 291 MB.

Quote
doing math to calculate the highest bitrate possible that will still get me under or at 291 MB
I'm not sure what you mean by that...  With FLAC you have very-little control over the bitrate, except that you can start with a lower-bitrate original (a lower sample, rate or lower bit-depth, etc.).



Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #6
Look up lossywav as pdq says.

Your recordings are probably very quiet if you need to tenfold the volume. When you convert to MP3 you probably don't increase the volume BEFORE the conversion, so encoder's psychoacoustic model discards a lot of sound being nearly under the threshold of hearing - hence the quality loss. MP3 conversion is a useless step in your case anyway.
Try the following:

1. Increase the volume of WAV with ReplayGain (look it up too) to a de-facto standard level
2. Process the WAV with LossyWAV so it is more compressible
3. Convert to (lossy)FLAC

It would be desirable to record closer to the sound source or with a more sensitive device so you can skip the 1st step and get better bit-depth/SNR (currently your sound is probably under 13bit/78dB SNR).

How long are your recordings?

Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #7
The OP should probably look for a means of dynamic range compression rather than just increasing the gain, preferably range compression during recording.

Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #8
Hi Luke, I've been using Audacity (http://www.audacityteam.org/) for exactly what you are doing for over 15 years for sermons, and my workflow is to first switch to mono, truncate silence to 2 secs or less, amplify to max without clipping, and apply compression.  I then save the audio to a 64bit MP3 file, and it is about 30Mb per hour.

Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #9
Thank you for all these replies. I will go over and answer these soon enough. To quickly answer one question: In order to upload to Bandcamp you must use FLAC, WAV, or AIFF and it must be under 291MB. For my math calculation, this is the formula: Length of time in seconds(x) = 291. For example, 3600x = 291. I would divide the left side by 3600 and the right side by the same. This would result in X = 0.08083. I then take this number and convert it to kiloBytes, not bits. The results is 80.83, but I just round down to 80 and boom! I could convert this file at a bitrate of 80 KB/s. This works really accurately with fre:ac but Format Factory is meh. I'm trying to figure out a way to result in more listen-able file concerning volume at the source recording level.

Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #10
Sounds like a prime use case for LossyWAV + FLAC.

With the record levels and gain: Note that when you record at a low input level, and then increase the volume later, you'll end up increasing the noise level, too. I suggest tweaking the recording setup, such that the levels are correct, or at least better, etc.

If you do this on a regular basis, etc. you might wanna have a look at SoX. It is my de-facto standard tool for audio batch processing. I'm pretty sure there are GUIs available for it, but I'm not familiar with them, I just use the command line.

You didn't say how many channels are recorded, I assume it is stereo (two channels). In case you record with just one microphone, make sure you only use one channel, etc. I've seen recorders default to dual-mono, etc.

SoX can do companding, as @pdq said:
The OP should probably look for a means of dynamic range compression rather than just increasing the gain, preferably range compression during recording.
Doing range compression during recording is preferable, but it's also possible to do it in post.

Check the man page, and search for "compand".

SoX also supports multi-band companding (command: "mcompand"), which is a little more complex, but after some playing around you'll probably find settings that work OK for you.

You can adjust loudness and gain similarly.

If you have time to spare, experiment a bit with FLAC compression levels, might as well try flac -8e, etc. LossyWAV also has a bunch of settings to try out, etc.

Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #11
OP, there is some misunderstanding here but I am struggling to explain so here's a solution...

If your only upload options are WAV/AIFF or FLAC then you need to convert the WAV files to a smaller wordsize (# of bits) and sample rate.  If they aren't already mono, you need to make them so.  This will dramatically lessen their size.  Here is an article that discusses how you do this:

https://www.tpx.com/support/using-audacity-2-0-x-save-wav-files/

You end up with new WAV files that are a fraction of the size of the originals.  If still not small enough, you can FLAC them but specify 8-bit output; this will cut the size in half.  If these sermons are primarily spoken word, the results should sound fine.

BTW, how long are these sermons anyway?  Ordinary WAV in mono should give you over an hour within 291MB.  If the sermons are longer than that, you might consider breaking them into parts to make it more convenient for people to download.

Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #12
[please delete, wrong thread]

Re: Looking for an Audio Converter that Limits File Size and Increases Amplitude

Reply #13
I think have all the necessary information to formulate a solution. A sincere "thank you" to all who participated. I hope this thread will help that future Googler in the future too.