Skip to content

Instantly share code, notes, and snippets.

View Alex1005a's full-sized avatar

Alex1005a

  • Saint Petersburg, Russia
View GitHub Profile
@Alex1005a
Alex1005a / telegram_speech_recotgnition.py
Created May 13, 2022 15:24
Recognize telegram voice message and reply text. Used telethon, SpeechRecognition and ffmpeg
from telethon.sync import TelegramClient
from telethon import events
import speech_recognition as sr
import subprocess
import os
r = sr.Recognizer()
api_id = api_id
api_hash = 'api_hash'
client = TelegramClient('session_name', api_id, api_hash)