what is the difference between
"mit jemandem sprechen" and
The expression "mit jemandem sprechen" means "to talk to someone", that is, to have a conversation. On the other hand "jemanden ansprechen" means "to address someone". For instance, "jemanden auf der Straße ansprechen" means "to address someone in the street".
However, depending on the context, "ansprechen" can also be translated by "talk" or other verbs. For instance, suppose you are in a party and reveal to your friend that someone caught your interested (you find him/her cute or attractive). Your friend could say: "Was wartest du denn? Du solltest sie/ihn unbedingt ansprechen!" "What are you waiting for? You should definetly talk to her/him!"
So "ansprechen" usually indicates an initial approach, either for a quick interaction, like asking for information, or for a conversation.