Because XMA was based on the lossy WMA format. Microsoft shilled this lame format(not XMA) as something that would surpass most audio formats(even MP3), and the result was nothing but disaster out of boasting the format(resulting in many WMA variants being developed, including the format itself) - and thus, XMA was born when Microsoft thought it was a good idea to make a WMA variant on their game console. Therefore it's lossy and compressed. You can also decode XMA files with ffmpeg as well.
For instance, the Windows version of Terraria uses 48kbps WMAv2 audio for its music.
The only way to get decent music from the Windows version is to steal the music package from the Mac version, which uses MS ADPCM for the audio, which is considerably higher quality.
The Linux version uses high quality audio as well, but the audio pack isn't compatible with XNA. Possibly because they may be using Ogg Vorbis there?
> But I found how to remove the noise of XMA, you just have to use ffmpeg to convert into 320k WMA, and it works
That seems odd, does converting to uncompressed 16-bit PCM WAV sound different than converting to 320k WMA?
I'd think that purely decoding to PCM with ffmpeg (vs with toWav) might produce better audio, whereas converting to WMA would involve another lossy encoding step. (unless ffmpeg has some way to losslessly rebuild XMA as WMA, which I doubt)
I forgot to add -ar 48000 (it's better). But I mean, when I convert into wav with towav, there's artifact (don't know how to explain) but with saxopohne instrument or guitar instrument there's a problem of artifact, like in this video : Hear the beginning, there's clearly a problem : https://www.youtube.com/watch?v=bwyYl8jEKyc
compared to this : https://www.youtube.com/watch?v=C1oVL0GDIKA
AND CONVERT INTO WMA is like the second video, and normal towav is the first. The second is not produced by ffmpeg through, I foudn it on the composer's website, but it's an example, the WMA conversion looks like the composr's website quality (and remove the artifact)
What? I didn't say that convert to wma give better quality, I said WMA remove the artifact compared to other formats. It's all about artifact, not quality.
But XMA _already is WMA_, just _lower quality WMA_. So when you're converting WMA to WMA, you're transcoding lossy to lossy, with another step of degradation.
I suppose if you think converting to higher bitrate WMA masks the artifacts of the lower bitrate WMA, you're welcome to do it. Just don't try to distribute the results to anyone.
Mygoshi, we're glad you were able to figure out a way to fix the files, but we suspect that something odd is going on that you aren't explaining correctly. We want the original XMA so we can do the conversion ourselves.
We're trying to understand what is going on, as converting to WMA instead of PCM WAV shouldn't result in any quality improvement. ffmpeg is almost certainly doing an internal XMA->PCM->WMA conversion. It might be that something else is playing back WMA and WAV differently on your system (or on Youtube?). Or maybe you're playing the old ToWav WAVs instead of the new ffmpeg WAVs?
It would be most helpful if you also include the exact command line you used with ffmpeg, both with converting to WMA and to WAV.
Thanks for putting up with us trying to understand this.
Ok, so the XMA i'm giving is not from the same game, but it's exactly same artifact problem with guitar instrument or saxophone for example. This one is not XMA 32khz through, (like the video), but this XMA i'm giving is a 44.1kHz. Here's the XMA : https://mega.nz/#!j5VzETII!2GY1Rg-_wHfxU-ZJWQc7bdqOzuMVioVC4QAJ1h_-DVQ
And here's the command I used to convert into wma : ffmpeg -i airport_race_4.xma -ar 48000 -b:a 320k airport_race_4.wma
and to test to wav or other I simply did : ffmpeg -i airport_race_4.xma airport_race_4.wav (that ToWav do automatically) or ffmpeg -i airport_race_4.xma -b:a 320k airport_race_4.wav (not sure if I have to put 320k or 4096)
You will hear that WMA remove the artifact (not totally) on guitar instrument, and WAV or MP3 don't remove it. (but I think WAV is better if you don't think about artifact, just quality)
It's better to have audio sampled at 48000 than 44100, but you can't make 44100 better by resampling to 48000; resampling can't recreate frequencies that are missing from the input signal.
Here's one (unlikely) possibility Mygoshi could be correct:
* When FFmpeg decodes XMA, it introduces artifacts * FFmpeg translates XMA to WMA without reencoding the content * Playing the resulting WMA file (in a non-FFMPEG player) does not introduce artifacts
The third bullet is probably true. The first two, less likely.
Then you'll have to ask the original game developers to waste more bits on higher quality audio, because FFMPEG decodes it with the "full" quality that is available.
XMA is essentially WMAv2. It is also usually encoded at really terrible bitrates. Encoding to higher bitrates to the same format again *may* mask the original artifacts with all new artifacts, while any other encoder/format would actually try to reproduce those artifacts in an effort to reproduce the "original" (decoded from XMA) signal.
But the problem is that I can't hear any bad quality/artifacts when playing Xbox 360 games you know. There's no solution to get a converted file that sounds in game? You will say that games uses filter or some tools to increase the quality but no, not of all games use this, and they even don't have any artifacts.