Kartikeyssj2 commited on
Commit
bf1ce78
1 Parent(s): 030ef66

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -5
main.py CHANGED
@@ -88,11 +88,11 @@ async def get_rnc():
88
 
89
  @app.post('/pronunciation_scoring')
90
  async def upload_audio(file: UploadFile = File(...)):
91
- # Read the uploaded file as bytes
92
- contents = await file.read()
93
-
94
- # Load audio from bytes using librosa
95
- y, sr = librosa.load(io.BytesIO(contents), sr=16000)
96
 
97
  # Tokenize audio
98
  print("Tokenizing audio...")
 
88
 
89
  @app.post('/pronunciation_scoring')
90
  async def upload_audio(file: UploadFile = File(...)):
91
+ url = "https://speech-processing-6.onrender.com/process_audio"
92
+ files = {'file': file}
93
+
94
+ # Make the POST request
95
+ audio = requests.post(url, files=files)
96
 
97
  # Tokenize audio
98
  print("Tokenizing audio...")