ATmega4808 and volume library

I’m trying to run the volume library and volume2 on my ATmega4808 (with MegaCoreX).
It is written that both library support AVR, but I just cannot compile the code.

With volume2.h I get these errors:
'TCCR0B' was not declared in this scope
'TCCR1A' was not declared in this scope
'TCNT1' was not declared in this scope
'OCR1A' was not declared in this scope
'CS12' was not declared in this scope
And many more

With volume.h I get
_SPEAKER' was not declared in this scope
If I add it as a #define into the Volume.cpp I get many errors like in the volume2.h

How can I play a sound with volume control in the ATmega4808?

Please check the datasheet of ATmega4808. https://ww1.microchip.com/downloads/en/DeviceDoc/ATmega4808-4809-Data-Sheet-DS40002173A.pdf
I doubt that the register names are different from what you have written in the code.

A megaAVR is not an AVR. The registers that the compiler complains about don't exists in the 4808.

I haven’t written anything.
I just loaded the example->volume-> volume test sounds and compiled it.
It seems that these two libraries don’t support the ATmega4808.

I would be happy to tweak any of the two, But I have a clue what these registers even mean.

As you can understand I'm not a pro programer, and don't know all these details...
Is there any other library with volume that does support the 4808?

I have no idea.

Which libraries are involved?

I only tried the “volume” and “volume2” by Connor Nishijima, and used the example code of both.
The board uses “MegaCoreX” by MCUdude

I had a look at the volume2 library; there is no easy way to modify it without understanding the internals of the 4808.

I also looked at the volume3 library; it includes a copy of an additional library (TimerOne). I had some hope that the original was possibly rewritten to include the MegaAVR but it isn't.

So I can't help further, sorry.

Thanks for tyring!