Spaces:
Runtime error
Runtime error
Commit
·
0072254
1
Parent(s):
0d55d3e
Initial commit
Browse files
app.py
CHANGED
@@ -38,8 +38,14 @@ def process_audio(audio_file):
|
|
38 |
]
|
39 |
return json.dumps(output_data)
|
40 |
|
|
|
41 |
def process(audio):
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
43 |
for item in result:
|
44 |
item['timestamp'] = list(item['timestamp'])
|
45 |
return json.dumps(result)
|
|
|
38 |
]
|
39 |
return json.dumps(output_data)
|
40 |
|
41 |
+
|
42 |
def process(audio):
|
43 |
+
# Read audio data from the file
|
44 |
+
with open(audio.name, 'rb') as f:
|
45 |
+
audio_data = f.read()
|
46 |
+
|
47 |
+
# Process the audio data
|
48 |
+
result = pipe(audio_data)['chunks']
|
49 |
for item in result:
|
50 |
item['timestamp'] = list(item['timestamp'])
|
51 |
return json.dumps(result)
|