Передача потока в FFmpegPCMAudio
@commands.command(aliases=data_aliases['analogue']['tts'])
async def _TTS(self, ctx, *, text: str = None):
global gTTS
translator = Translator()
speech = None
x = translator.translate(text)
channel = ctx.author.voice.channel
vc = await channel.connect()
if x.src == 'ru':
speech = gTTS(text=text, lang='ru', lang_check=True, tld='ru').stream()
elif x.src == 'en':
speech = gTTS(text=text, lang='en', lang_check=True, tld='com.au').stream()
else:
speech = gTTS(text=text, lang='en', lang_check=True, tld='com.au').stream()
vc.play(nextcord.FFmpegPCMAudio(speech.read(), pipe=True))
Как передать поток speech в FFmpegPCMAudio?
Command raised an exception: AttributeError: 'generator' object has no attribute 'read'