Audio file to gcode is not difficult. Here's a record laser cut into a tortilla [0].
I once tried to mill one out of MDF on a CNC machine [1]. It didn't sound very good, but better than I expected.
3D printing one seems very difficult, since 3D printers build walls instead of cut grooves. Maybe you could play it if you had some kind of bifurcated needle? Anyways, it's enough of a joke that it probably wouldn't work well that it was a Prusa April fools joke [2].
A better printer, maybe a resin one, can do it [3].
0 - https://www.youtube.com/watch?v=rdzCv_9eaoM
1 - https://hackaday.com/2022/06/17/wooden-you-like-to-hear-a-cn...