Editing FLAC: after removing glitches file size increases

This section is now closed.
Forum rules
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.1.x version.

The final version of Audacity for Windows 98/ME is the legacy 2.0.0 version.
Locked
mdubin
Posts: 149
Joined: Thu Mar 10, 2011 3:09 pm
Operating System: Please select

Editing FLAC: after removing glitches file size increases

Post by mdubin » Tue Oct 18, 2011 8:35 am

Hi:

All along, I had been joining mp3 tracks into a single track, converting this track to WAV, and then using audacity to isolate the glitches and edit them out. The resulting WAV file was always a bit smaller in size than the original before editing.

Now to save space, I started converting to FLAC instead of WAV and editing the FLAC file in the same manner. However, I notice that the resulting FLAC file is larger in size than the original. I am wondering why since I removed small bits of extraneous audio from it.

Any ideas?

mdubin

mdubin
Posts: 149
Joined: Thu Mar 10, 2011 3:09 pm
Operating System: Please select

Re: Editing FLAC: after removing glitches file size increase

Post by mdubin » Tue Oct 18, 2011 4:53 pm

To paraphrase my concern differently:

If I import a FLAC (lossless) file, and the only thing I do is edit out small portions of glitched audio (originating from joined mp3 files), then the FLAC file I export should not have its sound quality altered in any way. Is that correct?

If so, then I will not worry about file sizes.

Thank you.

mdubin

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Editing FLAC: after removing glitches file size increase

Post by steve » Tue Oct 18, 2011 5:16 pm

mdubin wrote:If I import a FLAC (lossless) file, and the only thing I do is edit out small portions of glitched audio (originating from joined mp3 files), then the FLAC file I export should not have its sound quality altered in any way. Is that correct?
Basically yes, though by default Audacity will add "dither" when exporting so there will be a very small difference.
If you are processing audio, then dither is beneficial as it prevents quantize distortion, though it does add a tiny bit of noise.
If you are not processing or mixing the audio (for example if you are only using Cut, Paste, Delete, Trim) then for perfect results you can temporarily disable dither in Preferences ("Edit > Preferences > Quality" and set "Dither" in the "High Quality" section to "None"). If you do this, remember to switch it back on again, as for most jobs it is beneficial - I'd recommend using "Shaped" or "Triangle" dither in the High Quality section (leave it at "None" in the "Real Time" section for optimum performance).

It is very easy for FLAC to compress silence - my mental picture is that if there is 2 seconds of silence, Flac says "do nothing for 2 seconds". Removing silence can make the remaining audio more "complex" and the greater the complexity, the harder it is for Flac to compress, thus a larger file size.

With other compressed audio formats you will see that removing short sections of silence has very little effect on the file size. As with Flac lossy compression formats find it easy to compress silence, but unlike Flac they do not need to be absolutely exact, so they can brush over a bit of the increased complexity so you probably won't see the file size increase.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

mdubin
Posts: 149
Joined: Thu Mar 10, 2011 3:09 pm
Operating System: Please select

Re: Editing FLAC: after removing glitches file size increase

Post by mdubin » Tue Oct 18, 2011 6:16 pm

Steve:

Thanks for the detailed explanation. I only do editing involving cutting audio glitches or sometimes splitting a large track into smaller ones. I already disabled dither quite awhile ago since I am not processing any audio. Back then I was having a problem with added noise in my output. But this has disappeared since I disabled dither and the audio quality of my exports are the same as what was imported. That is also due to the fact that I made sure the input and output settings match (PCM 16 bit etc.)

All the audio I import is created from downloaded MP3 (320) tracks joined together and converted as a single track to either WAV or (lately FLAC).

So from your explanation, it appears that everything should be fine with my final exported FLAC files.

mdubin

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Editing FLAC: after removing glitches file size increase

Post by steve » Tue Oct 18, 2011 8:11 pm

It was not so much an "explanation", more of a "fuzzy picture", so I'm pleased that it made some sense :)
Yes, it sounds like everything should be fine.

By the way, if ever you do want to do any processing, but the noise during "silent" parts is too annoying, then you can use "rectangle" dither. This form of dither is not quite as smooth as triangle or shaped, but smoother than quantize errors (no dither), and it has the advantage that absolute silence remains as absolute silence.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

DVDdoug
Forum Crew
Posts: 9419
Joined: Fri Sep 10, 2010 11:30 pm
Operating System: Windows 10

Re: Editing FLAC: after removing glitches file size increase

Post by DVDdoug » Tue Oct 18, 2011 9:42 pm

I haven't tried it, but in theory dither could make the FLAC file bigger. Dither is noise, and noise (randomness) is hard to compress. It won't make a WAV file bigger.

You can also choose the "level" of compression, which will affect file size. Level 8 will give you the smallest file, but compression takes longer. (Of course all levels are lossless, so the audio quality is not affected by this setting.)
The resulting WAV file was always a bit smaller in size than the original before editing.
WAV files are easy! ;) As long as you know there are 8 bits in a byte, you can calculate file size:
Bytes per sample x Sample Rate x Playing Time in Seconds.
i.e. There are 4 bytes per sample in a 16-bit stereo file, and there are 44,100 samples per second in a 44.1kHz WAV file ripped from a CD.

With lossy files (MP3 etc.) file size is a function of bitrate (kbps = kilobits per second). If you allow for some rounding:
File Size in MB = Bitrate in kbps x Playing time in minutes / 140

The only problem is, with variable bitrate (which are most commmon with lossy formats), you need to know the average bitrate. If you know the bitrate this formula works for any format.

mdubin
Posts: 149
Joined: Thu Mar 10, 2011 3:09 pm
Operating System: Please select

Re: Editing FLAC: after removing glitches file size increase

Post by mdubin » Wed Oct 19, 2011 5:43 pm

I just want to thank everyone for their replies and emphasize what a great product Audicity is.

Yesterday I purchased and downloaded a symphony in MP3 320kbps format which is in four movements but played without any breaks.

I joined all four mp3 files into one large file using Visual MP3 splitter/joiner (this software does not alter the audio quality in any way). Then I converted the large MP3 320kbps file to FLAC with another software. Using audacity I was able to import the FLAC file and remove all three glitches. The resulting single seamless FLAC file was exported and then burned to CD-R via ImgBurn.

The sound quality of this recording was phenomenal especially considering that it originated from a lossy format (although I have never been able to distinguish between MP3 at 320dbps and FLAC or WAV).

So I no longer have any concerns.

mdubin

Locked