šļøšÆ ××××× ××××ר ××¢×ר××Ŗ ā ××× ×, ×××××Ŗ×, ×××××§!!
-
@MGM-IVR ×××× ×××Ŗ ××××× × ××××Ŗ× ×©×× ×¦×Ø×× ×××× ××” ××× ××Ŗ
-
@y6714453
××× ××§×××× ××Ŗ ×××§××× ××§×××Ŗ ×שרת? -
@××¢××ר-××××× ××ר××Ŗ ×§××ׄ..
-
@CUBASE
×× ×× ×Ŗ×××× ×§×¦×Ŗ
××§×× ×××××Ŗ ××ש×× ××Ŗ ×©× ×××§××× ××× ×××ר×× ××ש××× ××××× ××× ××§×× ×××Ø× -
××× ××§×××× ××Ŗ ×××§××× ××§×××Ŗ ×שרת?
ש××××Ŗ API ×¢× ×××ר××Ŗ ×ש×× ××× ××:
type=api api_link=https:// api_000=stockname,no,record,/9,,no,yes
-
@y6714453
×ש×× ××צ×ר ×××Ŗ× ×§×©×Ø ×× ×ש×! -
@פ×××” ××Ŗ× ×
ļø
××××× ××××ר ××¢×ר××Ŗ ā ××× ×, ×××××Ŗ×, ×××××§!!:
@y6714453
×ש×× ××צ×ר ×××Ŗ× ×§×©×Ø ×× ×ש×! -
-
×ש×× ××¢×ר×. עש××Ŗ× ××Ŗ ××§×× ××× ××Ø× ×ר.
×× ×××ר ×××××Ŗ ××××ר ×ש×××× ×©× ×××××× ××××ר? (×× ×§×× ×©×××ר ×ש××× ××× ××Ŗ ××רת ×××××ר ×©× ××××××import os import tempfile import logging import requests from flask import Flask, request, jsonify from pydub import AudioSegment import speech_recognition as sr # ------------------ Logging ------------------ logging.basicConfig( level=logging.INFO, format="%(asctime)s | %(levelname)s | %(message)s", datefmt="%H:%M:%S" ) app = Flask(__name__) # ------------------ Telegram Config ------------------ TELEGRAM_BOT_TOKEN = "***" TELEGRAM_CHAT_ID = "***" # ------------------ Helper Functions ------------------ def add_silence(input_path: str) -> AudioSegment: audio = AudioSegment.from_file(input_path, format="wav") silence = AudioSegment.silent(duration=1000) return silence + audio + silence def recognize_speech(audio_segment: AudioSegment) -> str: recognizer = sr.Recognizer() try: with tempfile.NamedTemporaryFile(suffix=".wav", delete=True) as temp_wav: audio_segment.export(temp_wav.name, format="wav") with sr.AudioFile(temp_wav.name) as source: data = recognizer.record(source) text = recognizer.recognize_google(data, language="he-IL") logging.info(f"Recognized text: {text}") return text except sr.UnknownValueError: return "" except Exception as e: logging.error(f"Speech recognition error: {e}") return "" def send_to_telegram(text: str, file_url: str): message = f"šļø ××××¢× ×××©× ×××ער××Ŗ:\n\n{text}\n\nš ×§××ׄ ×××§×××:\n{file_url}" url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage" requests.post(url, data={"chat_id": TELEGRAM_CHAT_ID, "text": message}) # ------------------ API Endpoint ------------------ @app.route("/upload_audio", methods=["GET"]) def upload_audio(): file_url = request.args.get("file_url") if not file_url: return jsonify({"error": "Missing 'file_url' parameter"}), 400 logging.info(f"Downloading audio from: {file_url}") try: response = requests.get(file_url, timeout=15) if response.status_code != 200: return jsonify({"error": "Failed to download audio file"}), 400 with tempfile.NamedTemporaryFile(suffix=".wav", delete=True) as temp_input: temp_input.write(response.content) temp_input.flush() processed_audio = add_silence(temp_input.name) recognized_text = recognize_speech(processed_audio) if recognized_text: send_to_telegram(recognized_text, file_url) return jsonify({"recognized_text": recognized_text}) else: send_to_telegram(" ×× ×××× ××××ר.", file_url) return jsonify({"recognized_text": ""}) except Exception as e: logging.error(f"Error: {e}") return jsonify({"error": str(e)}), 500 # ------------------ Run ------------------ if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host="0.0.0.0", port=port)
-
@××¢×§×-1
×ש×××× ××Ŗ× ×¦×Ø×× ×××××ר ש×ש×× ××Ŗ ×××§××× ×שרת
××× ×Ŗ×××ר ××type=api api_link=ש×× ××Ŗ ×××× ×§ ×©× ×שרת api_000=stockname,no,record,/9,,no,yes ××××× ×ש×××× ×× ××Ŗ××§ (××××ׄ) api_hangup_send=no ××¢×ר ××”××× api_end_goto=/ש×× ××Ŗ ×× ×Ŗ×× ×××¢×ר
××× ×Ŗ×©×× ×××¢×××Ŗ ×§××ׄ ש××¢ ××©× 000 ×ש×××× ×©×××ר ×ש×× ××× "×× × ××§×× ××Ŗ ××××¢×Ŗ×, ×××”××× ×קש ×”×××××Ŗ"
-
@y6714453 ×Ŗ×××!
-
@××¢×§×-1
×ש××× ××× ××¢ ש×××× - ×Ŗ××××£ ××××ר××Ŗ ×ש×××× ×××§××api_000=stockname,no,record,/9,,no,yes
××Ŗ ××:
api_000=file_url,no,record,/9,,no,yes
×××× ×©××§×× - ××× ××פש פר××ר ×ש×
file_url
××¤× ×ש××Ø× ××××Ŗ ××§××file_url = request.args.get("file_url")
-
@××¢×§×-1 ×צ×××Ŗ ×××Ŗ×§×× ffmpeg ×¢× Render ××× ×©××× ×§×Ø×” ××Ŗ×××× ××× ×××??
-
@CUBASE ××Ŗ× ×
ļø
××××× ××××ר ××¢×ר××Ŗ ā ××× ×, ×××××Ŗ×, ×××××§!!:
ffmpeg
×× ×§×Ø×”
-
@y6714453 ×ש ×× ××××Ŗ ש×××××Ŗ ×××× × ×Ŗ×× ×©×××
×× ×× ×9 ×ש××Ø× ××××Ŗ?
api_000=file_url,no,record,/9,,no,yes -
@××¢×§×-1
×××¤× ×××§××× × ×©×רת
צ×××× ×××ש××× ×©× ××××××:××¢×Ø× ×ר×××¢× (××§×××)
××¢×Ø× ×× × ××Ŗ× ×××××ר ×××× ×Ŗ×ש×ר ×××§××× ××ער××Ŗ
×ר×רת ×××× ×× × ×©×ר ××Ŗ××§××× ×©××××רת ×-api_dir
× ××Ŗ× ×××××ר ×××§×× ×©×× ×
××××××
/8
(×”×ש ש××× ×)
×××§×Ø× ××× ×××§××× ×Ŗ×ש×ר ×ש×××× 8
×ער×: ×××× ×ש××/
×××Ŗ×××. ××”×ר ×ש××/
××”××£ -
@CUBASE ××Ŗ× ×
ļø
××××× ××××ר ××¢×ר××Ŗ ā ××× ×, ×××××Ŗ×, ×××××§!!:
@××¢×§×-1 ×צ×××Ŗ ×××Ŗ×§×× ffmpeg ×¢× Render ××× ×©××× ×§×Ø×” ××Ŗ×××× ××× ×××??
××× ×©×קר××”? ×× × ××©× ×”×¤×Ø×× ××××, ×× ×× × ×Ŗ×××Ŗ??
-
@y6714453 ××××Ø× ×××××Ŗ רש××× ×©× ×ש×××× ×©×× ×××§××× ×Ŗ×ש×ר ×× ×©××× × ××§× ××Ŗ ×××§××× ×××ר×? ××× ×× ×××× ××××ר ש×××× ×©×× ×××¦× ××Ŗ ×× ×Ŗ×× 6&file_url=/9/000.wav
-
@××¢×§×-1 ××Ŗ× ×
ļø
××××× ××××ר ××¢×ר××Ŗ ā ××× ×, ×××××Ŗ×, ×××××§!!:
@y6714453 ××××Ø× ×××××Ŗ רש××× ×©× ×ש×××× ×©×× ×××§××× ×Ŗ×ש×ר ×× ×©××× × ××§× ××Ŗ ×××§××× ×××ר×? ××× ×× ×××× ××××ר ש×××× ×©×× ×××¦× ××Ŗ ×× ×Ŗ×× 6&file_url=/9/000.wav
×ש×××× ×©×× ×××§××× ×Ŗ×ש×ר - ××× ×§×©×Ø ××× ×©×שרת ××§××, (××Ŗ× ×××× ×× ××ש××ר ××Ŗ ××¢×Ø× ×Ø××§ ××× ×××§××× ×Ŗ×ש×ר ××Ŗ××§×××
api_dir
).
×× ×× ××”××× ×ש××××.×Ŗ×¢×× ×¤× ××Ŗ ×ש×××× ×©××Ŗ× ××§××
-
@y6714453
-××Ŗ××Ŗ× ×ש×××× ×××§×× 9 - 9715, ×××× ×× ×××¦× × ×Ŗ××
11:18:22 | ××××¢ | ××ר×× ××××× ×: https://www.call2all.co.il/ym/ivr2/9715/000.wav
11:18:23 | ש×××× | ××ר××Ŗ ××§××ׄ × ×ש×× , ×”××××”: 404
11:18:23 | ××××¢ | 127.0.0.1 - - [21/×××§×××ר/2025 11:18:23] " ×§×× /upload_audio?ApiCallId=41c5197c930a84efea2dd8376b949af8994aa0cc&ApiYFCallId=6e6431b4-32d1-4b97-931b-f908c52a096d&ApiDID=&ApiRealDID=&ApiPhone=&ApiExtension=9713&ApiTime=1761045496&file_url=/9715/000.wav HTTP/1.1 " 400 -
. -
@××¢×§×-1 ×××Ŗ×××Ŗ ××× × × ××× ×, ×× ×××ר ×××××Ŗ
https://www.call2all.co.il/ym/api/DownloadFile?token=$token&path=ivr2:/9715/000.wav