Alternatively, you could try to install a GSI instead of a fully custom built ROM, that’s how I got a custom rom back when I had a Samsung A03 Core. But even then, the way android is locked down on each device along the absurdly short support Motorola offers is really infuriating.
I haven’t tried it personally, but there is a Linux software called QMMP, which is kinda like a winamp clone.
Maybe it has compatibility with said formats?