Changed to gtts

This commit is contained in:
Joan Cano
2023-07-24 19:53:48 +02:00
parent f06129349f
commit 82d0d639e7
2 changed files with 4 additions and 4 deletions

View File

@@ -2,5 +2,4 @@ Pyrogram==1.4.0
TgCrypto==1.2.5
pytgvoip==0.0.7.1
pytgvoip-pyrogram==0.0.11
TTS==0.15.6
numpy==1.22.0
gTTS==2.3.2

View File

@@ -1,6 +1,6 @@
import asyncio
import os
from TTS.api import TTS
from gtts import gTTS
import random
import string
@@ -29,7 +29,8 @@ voip_service = VoIPFileStreamService(client, receive_calls=False)
async def callme(cl, message: pyrogram.types.Message):
message = message.text.split('/callme ')[1]
audio_name = get_random_string(10)
tts.tts_to_file(text=message, file_path=f"/data/audio/{audio_name}.wav")
tts = gTTS(text=message, lang="es")
tts.save(f"/data/audio/{audio_name}.wav")
os.system(f"ffmpeg -i /data/audio/{audio_name}.wav -f s16le -ac 1 -ar 48000 -acodec pcm_s16le /data/audio/{audio_name}.raw")
await client.send_message(message.from_user.id, "test jejeje")