I have a standalone iMessage app that sends a sound file to another recipient. The sounds are .wav files, that are assets inside the app, with names like surprise.wav.
When I send the file, the sender sees the file being sent as surprise.wav, but the receiver gets a more random sound file name, like ms-0aeTxG.m4a.
Why is that happening? Is there a way to force the sound file name to be retained?
(I tried changing the title of the file's ID3v1 and ID3v2 metadata, but that didn't change the result)
Thanks to @pierpy for pointing me to the solution.
The .wav files I was using are lossless, but can be quite large; somehow (on Apple's servers?) the sound files were being converted to a lossy, but quite small .m4a format, which changed the prefix file name as a result.
I changed all my sound files to the MPEG-4 format, using either afconvert (see this post for some hints), or using Apple's "Digital Masters Droplets" for a drag and drop solution (which sometimes needed tweaking a little to work with my sounds).
afconvert -v -f m4af -d aac -b 192000 -s 2 oldfile.wav newfile.m4a
It all works as expected now.