It may depend on what keyboard you use. If you are using the default Android keyboard, when entering message, you should see a microphone icon on the keyboard tap it and start to talk to enter text.
how to turn on talk to text on sony xperia