I am trying to play an mp3 file, but cannot, because I get this error when trying to run pygame.init()
The code below works, but gives an error message (video system not initialized).
from gtts import gTTS
import pygame
t = str(input('Texto: '))
tts = gTTS(text=t, lang='pt-br')
tts.save('test.mp3')
pygame.mixer.init()
pygame.mixer.music.load('test.mp3')
pygame.mixer.music.play()
pygame.event.wait()
The code below doesn't run and gives an error message (Module 'pygame' has no 'init' member):
from gtts import gTTS
import pygame
t = str(input('Texto: '))
tts = gTTS(text=t, lang='pt-br')
tts.save('test.mp3')
pygame.init()
pygame.mixer.music.load('test.mp3')
pygame.mixer.music.play()
pygame.event.wait()
How do I solve this issue?