Delete agent.py
Browse files
agent.py
DELETED
|
@@ -1,28 +0,0 @@
|
|
| 1 |
-
# agent.py
|
| 2 |
-
|
| 3 |
-
from audio_utils import record_audio, transcribe_audio
|
| 4 |
-
from deep_model import predict_accent
|
| 5 |
-
|
| 6 |
-
class AccentAgent:
|
| 7 |
-
def __init__(self, duration=5):
|
| 8 |
-
self.duration = duration
|
| 9 |
-
self.audio_path = None
|
| 10 |
-
self.transcription = ""
|
| 11 |
-
self.accent = ""
|
| 12 |
-
|
| 13 |
-
def run(self):
|
| 14 |
-
print("[Agent] Starting recording...")
|
| 15 |
-
self.audio_path = record_audio(duration=self.duration)
|
| 16 |
-
print("[Agent] Audio recorded at:", self.audio_path)
|
| 17 |
-
|
| 18 |
-
print("[Agent] Predicting accent...")
|
| 19 |
-
self.accent = predict_accent(self.audio_path)
|
| 20 |
-
|
| 21 |
-
print("[Agent] Transcribing audio...")
|
| 22 |
-
self.transcription = transcribe_audio(self.audio_path)
|
| 23 |
-
|
| 24 |
-
return {
|
| 25 |
-
"audio_path": self.audio_path,
|
| 26 |
-
"accent": self.accent,
|
| 27 |
-
"transcription": self.transcription
|
| 28 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|