Sometimes God uses different methods to get through to us. He did this exact thing with Balaam. God tried to get his attention many times with sending an angel to him but he just ignored the angel. By the third time God just got tired of his disobedience and chose to use his donkey to get his attention. I can only what was going through Balaams head when the donkeys began to speak. He probably thought to himself what is going on here. He probably thought he was going crazy. But no God was using the donkey.
We can become like Balaam if we are not careful. When we are being asked to do something for God we can become disobedient like he did and he will use something to get our attention. But we also need to make sure that it is him.