Text to Speech Conversion using Python

I am a student, and has taken python as a course subject. In one of the practical assignment, we need to convert text to speech, where the user will input some text and that needs to be converted to voice. Browsing over the internet i was able to write the below snippet of code, but this is generating error and i am not able to complete it.

from gtts import gTTS
str_text = 'This is a text message.'
speech_obj = gTTS()
sppech_obj.text = str_text

Error message:

TypeError                                 Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_31208/3692117748.py in <module>
      1 from gtts import gTTS
      2 str_text = 'This is a text message.'
----> 3 speech_obj = gTTS()
      4 sppech_obj.text = str_text
      5 speech_obj.save("test.mp3")

TypeError: gTTS.__init__() missing 1 required positional argument: 'text'

Any help will be appreciable !