auto play when the app connect to the Bluetooth

hello I am using arduino mega 2560 bluetooth HC-05

and all I want to do is when the bluetooth connect to the app play the audio just .

I search in the internet so hard and I did't find anything to start with T.T

please help !!!

humandos:
I search in the internet so hard and I did’t find anything

No surprise there, your proposal is as fraught with difficulty as it is nebulous and, no matter what you do with Arduino, there is probably a better way without one. For starters, you are likely to have Bluetooth protocol problems. The HC-05 is a plain-vanilla SPP device and is great at that, but doesn’t do anything else.

bluetooth connect to the app play the audio just .

is incoherent, and I assume English is a second language, which is OK but I don’t think you should expect Arduino to play audio very well - if that is what you mean. It could control an audio player, which is its proper purpose, and you could control an Arduino that does that with another via bluetooth.
So you might start here
Now this would normally be a prelude to a data signal, but it may be possible to configure bluetooth to do what you want by virtue of its changing state.

. . . and all I want to do is when the bluetooth connect to the app play the audio . . .

@Nick:

If you had a Toyota you would understand.

As soon as your phone connects to the car's bluetooth the car audio starts playing something from your phone. If you were previously listening to a song or audiobook it plays that, otherwise it selects something at random.

My guess is that the system was designed by a demented teenager (sorry @humandos) There seems to be no way to disable the action.

Don

I'll have to talk to my daughter about this, she drives a Toyota. In the meantime I will stick with my Ford Falcon, and thank God I'm spared of such things.