Skip to main content

Notice

If you are using a Hotmail or Outlook email address, please change it now, as Microsoft is rejecting all email from our service outright.
Topic: Are loss in a convertion M4A TO FLAC? (Read 687 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Are loss in a convertion M4A TO FLAC?

Or have the same quality?

Also M4A is a lossy format?

Re: Are loss in a convertion M4A TO FLAC?

Reply #1
Or have the same quality?
Also M4A is a lossy format?

1.  M4A->FLAC would yield same quality.
2.  M4A is "normally" a lossy format, unless it contains the ALAC (Apple Lossless) codec instead of regular AAC.


Re: Are loss in a convertion M4A TO FLAC?

Reply #3
This is not a foobar2000-specific question ... fb2k can tell you whether the codec is ALAC (in which case you can happily convert it,) or AAC (in case you would typically not want to - as long as you can play the lossy file, there is no use in converting it, a "fake lossless" only costs space).

Now if you insist on transcoding or just are curious: Lossy codecs generally work a bit different from integer-format lossless formats, and in order to avoid clipping upon conversion you need to watch out whether the peak is past full scale. Once you have done so, the converted file will be accurate to the bit depth of the target format (e.g. 16 bits), and incur a round-off error below that - but if e.g. the .m4a were created from a CD in the first place, what will be rounded off would be things that got lost in the conversion to .m4a in the first place.
High Voltage socket-nose-avatar

Re: Are loss in a convertion M4A TO FLAC?

Reply #4
This is not a foobar2000-specific question ... fb2k can tell you whether the codec is ALAC (in which case you can happily convert it,) or AAC (in case you would typically not want to - as long as you can play the lossy file, there is no use in converting it, a "fake lossless" only costs space).

Now if you insist on transcoding or just are curious: Lossy codecs generally work a bit different from integer-format lossless formats, and in order to avoid clipping upon conversion you need to watch out whether the peak is past full scale. Once you have done so, the converted file will be accurate to the bit depth of the target format (e.g. 16 bits), and incur a round-off error below that - but if e.g. the .m4a were created from a CD in the first place, what will be rounded off would be things that got lost in the conversion to .m4a in the first place.
I need to convert it in flac because the audio editor that i use dont have supp for m4a. My file is a lossy m4a 320 kbps, So I would not be losing anything by passing it to flac? The db levels are the same.

Re: Are loss in a convertion M4A TO FLAC?

Reply #5
audio editor

Oh, so if you want to edit the audio then you can usually not do so in the lossy domain (apart from cutting it and some volume changes ... including crude stepwise fading).

But then you would probably rather use PCM - .wav or .aiff - as that saves faster to drive when you work on it.  Also even floating-point 32-bits because floating-point safeguards from careless volume changes in the editing - provided your audio editor supports floating-point PCM.
If using foobar2000: Try .wav with 32-bit and see if your editor supports it.
Also the component https://www.foobar2000.org/components/view/foo_bitcompare can check if two files are bit-identical, and if they don't: how loud the differences are. If you use 16-bit PCM the differences would typically be around the -96 dB.
High Voltage socket-nose-avatar

Re: Are loss in a convertion M4A TO FLAC?

Reply #6
I need to convert it in flac because the audio editor that i use dont have supp for m4a.

To supplement what Porcus said, if the only editing you needed was losslessly trimming parts of the file, you could extract the AAC content from the M4A container using ffmpeg then, using Mp3directcut with libfaad2.dll added to its directory, edit the AAC file.  Afterwards you can re-wrap into M4A with ffmpeg.  A couple of command line scripts:

Extract AAC from M4A:  ffmpeg.exe -i "filename.m4a" -c:a copy "filename.aac"

Wrap AAC to M4A:  ffmpeg.exe -i "filename.aac" -codec copy "filename.m4a"

Awkward:  you would need to re-tag the file after this process.


Re: Are loss in a convertion M4A TO FLAC?

Reply #7
ffmpeg can do lossless trimming too, and does not need to go by way of aac. But you cannot see the waveform using the command line, so it might require a bit of trial and error to cut the right place. And if you want to do multiple ... ewww.

But with a little bit of messing around, I could verify that

ffmpeg.exe -ss 0.28 -i filename.m4a -codec copy filenamecutawaythefirstpointtwentyeightseconds.m4a

yields something bit-identical to the same cut in mp3directcut.
High Voltage socket-nose-avatar

Re: Are loss in a convertion M4A TO FLAC?

Reply #8
great i will check

and yes, i used ffmpeg several times to trimm and paste avoiding any posibble loss

but still M4A AAC TO Flac would be the same? I insist with this because i already edited the audio 2 days ago with the file in flac, so idk if is worth it to make the work again.

Re: Are loss in a convertion M4A TO FLAC?

Reply #9
but still M4A AAC TO Flac would be the same? I insist with this because i already edited the audio 2 days ago with the file in flac, so idk if is worth it to make the work again.

"Yes."  FLAC is a lossless format, therefore encoding to it from ANY other format will result in zero audio loss from the original file.  It will be just as good or just as bad as the original file.

Re: Are loss in a convertion M4A TO FLAC?

Reply #10
but still M4A AAC TO Flac would be the same? I insist with this because i already edited the audio 2 days ago with the file in flac, so idk if is worth it to make the work again.

"Yes."  FLAC is a lossless format, therefore encoding to it from ANY other format will result in zero audio loss from the original file.  It will be just as good or just as bad as the original file.
so its like a copy-paste with mouse's right click but with size increase

Re: Are loss in a convertion M4A TO FLAC?

Reply #11
but still M4A AAC TO Flac would be the same?

Use foo_bitcompare to verify that they are equal!

The reason why I don't want to come up with a resounding "Yes" is that AAC (and MP3 and most lossy codecs) can exceed digital full scale. FLAC cannot necessarily accommodate any audio stream - it does not support floating-point streams at all.
And again: if you want to do lots of editing, use floating-point PCM instead. And for a lossless format: WavPack instead of FLAC.
High Voltage socket-nose-avatar

Re: Are loss in a convertion M4A TO FLAC?

Reply #12
A few quick comments...

 - The loss happens during compression when information is thrown-away to make the file smaller, not during decompression.

 - When you play the file it get's decompressed.

 - When you open a compressed file with any "normal" audio editor it gets decompressed.   Most audio editors use floating-point internally, so that might be theoretically better than converting to FLAC (fixed point integer) but normally there is no audible difference.    (BTW - Audacity can open M4A if you install the optional FFmpeg import/export library.)   As was mentioned, there are some special-purpose editors that can do limited editing without decompressing.

 - If you re-save as M4A you are going through another generation of lossy compression.   The good news is that unlike most lossy formats, M4A is pretty-much immune to accumulated damage from multiple generations compression.

 - Although you should "never edit or do production with/from a lossy format", sometimes you don't have a choice.

 
SimplePortal 1.0.0 RC1 © 2008-2020