דילוג לתוכן

פיתוח ועיצוב אתרים

611 נושאים 5.3k פוסטים

קטגוריות משנה


  • מערכות ניהול תוכן ליצירה ותחזוקה של אתרי אינטרנט

    346 3k
    346 נושאים
    3k פוסטים
    ע"ה דכו"עע
    @דוד-33 כתב בשיתוף | "AIלמנט" מאגר הגרפיקה היהודית החינמית: @ezerphone @דוד-33 מה שכולם העלו איפה רואים את התמונות שאנשים מעלים? בדף הראשי, אבל יש עכשיו תקלה.
  • פיתוח web צד לקוח וצד שרת

    265 2k
    265 נושאים
    2k פוסטים
    ע
    @צדיק-תמים מישהו יודע מה הסיפור של השגיאה הזו? else if (toDo == 9) { let ans = await call.read([{type: 'text', data: "אנא הקלט משהו"}], "record"); console.log(ans); execFile("python3", ["/public_html/recognize.py",ans], (error, stdout, stderr) => { console.log(stdout); console.log(error); if (error) { console.error(error); call.id_list_message([{type:'text', data: "Error processing audio" }]); return; } console.log("הבעיה כאן! בפלט"); call.id_list_message([{type:'text', data: stdout}]); console.log("הבעיה כאן! בפלט"); }); } זה הקובץ פייתון (מתמלל מצוין, אגב) from pydub import AudioSegment import speech_recognition as sr from rapidfuzz import process, fuzz import sys, json, tempfile, requests token = "" BASE_URL = f"https://www.call2all.co.il/ym/api/DownloadFile?token={token}&path=ivr2:/" def add_silence(audio_segment): silence = AudioSegment.silent(duration=1000) return silence + audio_segment + silence def recognize_speech(audio_segment): recognizer = sr.Recognizer() 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) try: return recognizer.recognize_google(data, language="he-IL") except sr.UnknownValueError: return "" # לא זוהה דיבור except sr.RequestError as e: return f"Error: {e}" # בעיה עם ה‑API if __name__ == "__main__": # argv[1] = שם הקובץ בתוך ivr2:/ (למשל "1/003.wav") file_name = sys.argv[1] file_url = f"{BASE_URL}{file_name}" # 1️⃣ הורדת הקובץ מהאינטרנט response = requests.get(file_url) if response.status_code != 200: print("Error downloading audio file") sys.exit(1) # 2️⃣ שמירתו זמנית וטעינה עם pydub with tempfile.NamedTemporaryFile(suffix=".wav", delete=True) as temp_audio: temp_audio.write(response.content) temp_audio.flush() audio = AudioSegment.from_file(temp_audio.name, format="wav") # 3️⃣ הוספת שנייה שקט audio = add_silence(audio) # 4️⃣ זיהוי דיבור recognized_text = recognize_speech(audio) # ✅ הדפסת התוצאה print(recognized_text) השגיאה שאני מקבל: [716b56ab1a7cfd79b974fa0d55f5cbbd65915674]: Cannot send id_list_message after sending response (probably done from uncaughtErrorHandler due to error in asynchronous code after returning response) אני לא מוצא על איזה id_list_message הוא מתכוון... הוא לא משמיע כלום. גם לא את הid_list_message של השגיאה, בוודאות! הקטע שהוא רושם ללוג את 2 הטקסטים גם שלפני הid_list_message וגם שאחרי, ז"א שהריצה לא מסתיימת.