Assign audio to a screen touch in android by a jack input or a usb port

Hi everybody,
If I am writing this post today it is because I am not in the IT field and I would need your help please.
I am a student and in order to finalize my project I am thinking of using this solution (appium).
So here I will explain the concept clearly, i really hope someone can help me.

1.I have an Arduino machine that goes and put some audio.
2.Currently, I connect it to my computer with the serial port and I run a program in python in my pc in order to assign a key to the audio. (space) (pynput.keyboard.Key.space)
3.So every time my arduino makes a sound, then the python program attributes that audio to a key.

Today I would like to be able to use my python program to be able to use it on Android tablet and mobile.
I would put my Arduino in USB on a tablet. (or jack input if you have a solution with)
I then came across this open source and think it might be useful.
Could someone help me edit my python program so that it is usable on android ?

I would like to assign audio to a touch screen( TouchAction )

Thank you in advance if you think you can help me do not hesitate to do it here or send me an email, ([email protected])

Thanks you