Change of file length after adding to iTunes library

Operating System: Mojave 10.14.4
Audacity Version:2.3.1
Over the past few weeks before and after the upgrade to version 2.3.1 I have experienced difficulty with some (not all) m4a music files exported to Music on my MacBook Pro and then added to iTunes Library. The problem being that after adding to iTunes the length of some files increase massively. For example one file has increased from 4min 26sec to almost 788 hours with no apparent increase in the file size. If I export the file to Music as a WAV file and then add to iTunes Library and then convert to an AAC (m4a) file the file length does not increase. However, this defeats the purpose of exporting as an m4a file in the first instance.

This may have nothing to do with the Audacity software but I was hoping other users may have experienced something similar and know of a solution.

Other users have reported this and you have found the workaround. I export from Audacity to AIFF since it seems to better support metadata.
– Bill

The problem appears to be specific to files with “.m4a” file extension in very recent versions of iTunes.
An easy workaround is to give the files a file extension “.mp4”. There’s no need to re-encode, “.mp4” is a valid extension for .m4a files (as is “.aac”, but I’ve not tested that in iTunes).