I have a function using gTTS, pygame and os modules:
from gtts import gTTS
import pygame as pg
from os import remove as OSremove
music = pg.mixer.music
def speak(x):
sound = gTTS(text=x, lang="pl")
sound.save("temp.mp3")
pg.mixer.init()
music.load("temp.mp3")
music.play("temp.mp3")
pg.quit()
OSremove("temp.mp3")
And I'm getting an error: TypeError: an integer is required (got type str). Image here because I have 5 rep