Play audio file as system sound?

Hello,
is there any way to play some audio file by system as it does with all alerts etc. ?

For example I have button and on click I would like to play some alert sound but defined by myself instead system sound.

For any help great thanks in advance.

Windows: PlaySound function (Windows) | Microsoft Learn

MacOS: AVAudioPlayer | Apple Developer Documentation

Linux: Alsa Opensrc Org - Independent ALSA and linux audio support site

Hope this helps.