• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

About FLAC

JediMa

Active Member
Joined
Jul 14, 2020
Messages
193
Likes
65
Location
Italy
I'm really a noob about this so please be patient... I was wondering which was the best compromise with FLAC, 16 bit or 24 hi res and mostly if there is a way to check if the flac is ok or if it's with a wrong compression.
I've few issues with few songs on my FiiO M9 where some Flacs 24 bit have a weird background sound and other 24 bit ones play perfectly.
 

daftcombo

Major Contributor
Forum Donor
Joined
Feb 5, 2019
Messages
3,688
Likes
4,070
There is not reason why FLAC 24 bit would have a weird sound. Perhaps they were badly encoded.

FLAC 24 is like the compressed version of WAV 24 bit.
FLAC is the same for WAV 16 bit.
You can convert FLAC to WAV or WAV to FLAC without any loss.

I personnaly keep my music in FLAC 16 bit / 44.1 kHz or 16 bit / 48 kHz. They sound the same. I've never seen a study with ABX test proving that more bits sound better. So you probably won't hear a difference between FLAC and FLAC 24. That said, if you consider re-working the audio, you should get FLAC 24 for that.

There are 9 levels of compressing for FLAC: 0 to 8.
0 is the less compressed, 8 the most, but all are lossless. The different is the time it takes to compress/uncompress the files.
Some players take a bit too much time loading FLAC 7 or 8, so I like to use FLAC 5 or 6 which is a good compromise.
 

daftcombo

Major Contributor
Forum Donor
Joined
Feb 5, 2019
Messages
3,688
Likes
4,070
A way to check if the compression is wrong (I've seen 1 or 2 badly encoded FLAC on thousand files in my life) is to try to re-encode them to another FLAC level. If you can't, something was wrong with the file.

The most probable reason why some of your FLAC 24 have a "weird background" is that you stumbled upon vinyl rips. Which is not linked to the FLAC format per se.
 
OP
JediMa

JediMa

Active Member
Joined
Jul 14, 2020
Messages
193
Likes
65
Location
Italy
There is not reason why FLAC 24 bit would have a weird sound. Perhaps they were badly encoded.

FLAC 24 is like the compressed version of WAV 24 bit.
FLAC is the same for WAV 16 bit.
You can convert FLAC to WAV or WAV to FLAC without any loss.

I personnaly keep my music in FLAC 16 bit / 44.1 kHz or 16 bit / 48 kHz. They sound the same. I've never seen a study with ABX test proving that more bits sound better. So you probably won't hear a difference between FLAC and FLAC 24. That said, if you consider re-working the audio, you should get FLAC 24 for that.

There are 9 levels of compressing for FLAC: 0 to 8.
0 is the less compressed, 8 the most, but all are lossless. The different is the time it takes to compress/uncompress the files.
Some players take a bit too much time loading FLAC 7 or 8, so I like to use FLAC 5 or 6 which is a good compromise.
Thanks a lot that was the kind of reply I was hoping to get, so basically FLAC 24 are a waste of space and a "flawless" Flac 16 will play almost the same.
About those files sound ok on my desktop, I've that issue only on FiiO M9, it's like a cracking sound in backgroun. So should I convert back the weird flacs to WAV and reconvert them better to 16/ 48 kHZ? In this case which software should I use please?
 

daftcombo

Major Contributor
Forum Donor
Joined
Feb 5, 2019
Messages
3,688
Likes
4,070
Thanks a lot that was the kind of reply I was hoping to get, so basically FLAC 24 are a waste of space and a "flawless" Flac 16 will play almost the same. So should I convert back the weird flacs to WAV and reconvert them better to 16/ 48 kHZ? In this case which software should I use please?

You should keep the sample rate as is, or divide it by two to save space. 88.2 --> 44.1 kHz, 96 kHz --> 48 kHz is good practice. But if you plan to burn CDs, you could go 96 --> 44.1 kHz without major issues I guess.

But be careful which program you use to convert, especially if you want to reduce FLAC 24 to FLAC (16), because you could introduce some noise shaping. See here for a comparison of various software:
https://www.audiosciencereview.com/...e-sample-rate-converters-put-to-the-test.241/.
SoX is free and great but command-line based.
 

MRC01

Major Contributor
Joined
Feb 5, 2019
Messages
3,486
Likes
4,112
Location
Pacific Northwest
Thanks a lot that was the kind of reply I was hoping to get, so basically FLAC 24 are a waste of space and a "flawless" Flac 16 will play almost the same. ...
FLAC is just a lossless compressed version of a WAV file. It is completely transparent: when decoded, you get the exact same original bits.

That is, as long as when you FLAC encode use the same bit depth of the WAV file you're encoding: 16 or 24. The only time the bits will be different is, for example, if you encode a 24-bit WAVE file to FLAC-16.

Now, FLAC decoding takes some CPU, so a device might glitch if it can't do it in real time. Here's a real-world example I recently encountered:
Clean
Glitchy
The difference you hear, those little "tics" or gravely scratchy sound, is the CPU failing to keep up when decoding the audio file. This is not caused by the FLAC file. It is caused by improper buffering or CPU scheduling.
 
OP
JediMa

JediMa

Active Member
Joined
Jul 14, 2020
Messages
193
Likes
65
Location
Italy
FLAC is just a lossless compressed version of a WAV file. It is completely transparent: when decoded, you get the exact same original bits.

That is, as long as when you FLAC encode use the same bit depth of the WAV file you're encoding: 16 or 24. The only time the bits will be different is, for example, if you encode a 24-bit WAVE file to FLAC-16.

Now, FLAC decoding takes some CPU, so a device might glitch if it can't do it in real time. Here's a real-world example I recently encountered:
Clean
Glitchy
The difference you hear, those little "tics" or gravely scratchy sound, is the CPU failing to keep up when decoding the audio file. This is not caused by the FLAC file. It is caused by improper buffering or CPU scheduling.
So it's FiiO M9 hardware that struggles, on my computer that file sounds ok, it's also a very big flac but if you want to check what's wrong with it you can download it https://1drv.ms/u/s!AgDBFB1GyGx6jCdVeV7ElaH3hXfY?e=hgyNCa
 
Last edited:

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,693
So it's FiiO M9 hardware that struggles, on my computer that file sounds ok, it's also a very big flac but if you want to check what's wrong with it you can download it https://1drv.ms/u/s!AgDBFB1GyGx6jCdVeV7ElaH3hXfY?e=hgyNCa
https://www.foobar2000.org/components/view/foo_benchmark
Decoding speed of your 2496 flac is not much slower than other lossy codecs. More like the M9 has a poorly written flac decoder. Anyway, why advertise "Hi-Res" if it can't even decode a 2496 flac properly? Does it mean the processor is 100 times slower than a 6 years old i3 using a single thread?
speed.PNG
 
OP
JediMa

JediMa

Active Member
Joined
Jul 14, 2020
Messages
193
Likes
65
Location
Italy
I reset my M9 to default settings and now it's all working fine, so it was a software issue.. .
 

Daverz

Major Contributor
Joined
Mar 17, 2019
Messages
1,309
Likes
1,475
A quick command-line test of FLAC file integrity using the flac command itself is

Code:
flac -wts *.flac

You can use metaflac or sox to print metadata about FLAC files

Code:
metaflac --list *.flac
sox --i audio_file.flac

If you know the files are from CD, you can use cuetools to check the files against the AccurateRip or CTDB databases.

http://cue.tools/wiki/Main_Page

I've been seen a lot of FLAC downloads lately with no md5sum set. This is unfortunate as the md5sum ensures the integrity of the FLAC files. The only way I've found to set the md5sum -- which at least ensures the integrity of your own files when moving them or backing them up -- is to copy the FLAC files, e.g. with ffmpeg or sox. This preserves the tags, but doesn't copy embedded artwork.

Finally, you can check the frequency response of the files using the sox spectrogram effect

Code:
sox some_audio.flac -n spectrogram -o some_audio.png

You also could also try FakinTheFunk, which is meant to detect FLAC files upsampled from lossy files. I don't always find it very reliable (false positives and false negatives), particularly on piano music and older analog recordings. Checking the spectrogram is usually more reliable, but sometimes hard to interpret.

https://fakinthefunk.net/en/
 
Last edited:
Top Bottom