Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -12,6 +12,15 @@ import os
|
|
| 12 |
r = sr.Recognizer()
|
| 13 |
|
| 14 |
app = FastAPI()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
def resample_audio(input_path, output_path, target_sample_rate):
|
| 17 |
ffmpeg_cmd = [
|
|
|
|
| 12 |
r = sr.Recognizer()
|
| 13 |
|
| 14 |
app = FastAPI()
|
| 15 |
+
origins = ["*"]
|
| 16 |
+
|
| 17 |
+
app.add_middleware(
|
| 18 |
+
CORSMiddleware,
|
| 19 |
+
allow_origins=origins,
|
| 20 |
+
allow_credentials=True,
|
| 21 |
+
allow_methods=["*"],
|
| 22 |
+
allow_headers=["*"],
|
| 23 |
+
)
|
| 24 |
|
| 25 |
def resample_audio(input_path, output_path, target_sample_rate):
|
| 26 |
ffmpeg_cmd = [
|