Spaces:
Running
Running
Update audio_save.py
Browse files- audio_save.py +5 -5
audio_save.py
CHANGED
@@ -23,9 +23,9 @@ async def save_audio(audio: UploadFile = File(...), path: str = Form(...)):
|
|
23 |
|
24 |
print("Received Audio !!!!!")
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
|
30 |
# url = 'https://hellojarvis-asr-hindi.hf.space/transcribe'
|
31 |
# headers = {
|
@@ -40,9 +40,9 @@ async def save_audio(audio: UploadFile = File(...), path: str = Form(...)):
|
|
40 |
|
41 |
# if response.status_code == 200:
|
42 |
# transcription = response.json()
|
43 |
-
# return transcription
|
44 |
# else:
|
45 |
-
# return "Failed to transcribe audio", None
|
46 |
|
47 |
# if os.path.exists(f'{folder_path}.csv'):
|
48 |
# df = pd.read_csv(f'{folder_path}.csv')
|
|
|
23 |
|
24 |
print("Received Audio !!!!!")
|
25 |
|
26 |
+
Save the audio to the specified path
|
27 |
+
with open(path, "wb") as buffer:
|
28 |
+
shutil.copyfileobj(audio.file, buffer)
|
29 |
|
30 |
# url = 'https://hellojarvis-asr-hindi.hf.space/transcribe'
|
31 |
# headers = {
|
|
|
40 |
|
41 |
# if response.status_code == 200:
|
42 |
# transcription = response.json()
|
43 |
+
# # return transcription
|
44 |
# else:
|
45 |
+
# # return "Failed to transcribe audio", None
|
46 |
|
47 |
# if os.path.exists(f'{folder_path}.csv'):
|
48 |
# df = pd.read_csv(f'{folder_path}.csv')
|