Spaces:
Paused
Paused
Commit
·
5cee863
1
Parent(s):
562ec01
audio updated
Browse files
backend/routes/interview_api.py
CHANGED
|
@@ -81,7 +81,7 @@ def transcribe_audio():
|
|
| 81 |
temp_dir = "/tmp/interview_temp"
|
| 82 |
os.makedirs(temp_dir, exist_ok=True)
|
| 83 |
|
| 84 |
-
filename = f"user_audio_{uuid.uuid4().hex}.
|
| 85 |
path = os.path.join(temp_dir, filename)
|
| 86 |
audio_file.save(path)
|
| 87 |
|
|
|
|
| 81 |
temp_dir = "/tmp/interview_temp"
|
| 82 |
os.makedirs(temp_dir, exist_ok=True)
|
| 83 |
|
| 84 |
+
filename = f"user_audio_{uuid.uuid4().hex}.webm"
|
| 85 |
path = os.path.join(temp_dir, filename)
|
| 86 |
audio_file.save(path)
|
| 87 |
|
backend/services/interview_engine.py
CHANGED
|
@@ -42,7 +42,7 @@ def generate_first_question(profile, job):
|
|
| 42 |
"""
|
| 43 |
|
| 44 |
response = groq_llm.invoke(prompt)
|
| 45 |
-
return response.strip()
|
| 46 |
except Exception as e:
|
| 47 |
logging.error(f"Error generating first question: {e}")
|
| 48 |
return "Tell me about yourself and why you're interested in this position."
|
|
|
|
| 42 |
"""
|
| 43 |
|
| 44 |
response = groq_llm.invoke(prompt)
|
| 45 |
+
return response.content.strip()
|
| 46 |
except Exception as e:
|
| 47 |
logging.error(f"Error generating first question: {e}")
|
| 48 |
return "Tell me about yourself and why you're interested in this position."
|
backend/templates/interview.html
CHANGED
|
@@ -647,7 +647,9 @@
|
|
| 647 |
|
| 648 |
try {
|
| 649 |
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
| 650 |
-
this.mediaRecorder = new MediaRecorder(stream
|
|
|
|
|
|
|
| 651 |
this.audioChunks = [];
|
| 652 |
|
| 653 |
this.mediaRecorder.ondataavailable = (event) => {
|
|
|
|
| 647 |
|
| 648 |
try {
|
| 649 |
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
| 650 |
+
this.mediaRecorder = new MediaRecorder(stream, {
|
| 651 |
+
mimeType: 'audio/webm;codecs=opus'
|
| 652 |
+
});
|
| 653 |
this.audioChunks = [];
|
| 654 |
|
| 655 |
this.mediaRecorder.ondataavailable = (event) => {
|