Text-to-speech is a technology which converts written text into an audio file that can be listened to. The words spoken through a text-to-speech system are generated by a synthesized voice, which is usually created to sound like a person's voice, but doesn't actually need to be human.
Text-to-speech is not the same as listening to an audiobook. An audiobook has already been recorded and uploaded elsewhere. Text-to speech will read out what you write on your phone or computer screen aloud, so that you can listen to it through headphones or speakers.