I would like to play a sound (which I generate in a standalone app) when an event/notification occurs, like an incoming message or a notification from a game. For example: I receive a message in Telegram and the OS proceeds to "play the ringtone" (but it instead runs my sound-generating app).
I thought this behavior would require some interaction with the OS in order to "redirect" the default action of playing a ringtone's file to my app, so I could generate my sound and play it. But it's just a theory. xD :P
I searched in Google, but nothing showed up. :( I have made apps for Android, but in this issue I really have no clue of how to accomplish this. Thanks in advance for any help provided! :D