Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -395,23 +395,6 @@ class TTSResponse(BaseModel):
|
|
| 395 |
duration: float # seconds
|
| 396 |
audioPath: str
|
| 397 |
|
| 398 |
-
# ######## Convert your audio to Base64
|
| 399 |
-
# import base64
|
| 400 |
-
# import torchaudio
|
| 401 |
-
# import io
|
| 402 |
-
|
| 403 |
-
# def audio_to_base64(audio_path: str) -> (str, float):
|
| 404 |
-
# # load audio to get duration
|
| 405 |
-
# waveform, sr = torchaudio.load(audio_path) # waveform shape: [channels, samples]
|
| 406 |
-
# duration = waveform.shape[1] / sr # seconds
|
| 407 |
-
|
| 408 |
-
# # read file bytes
|
| 409 |
-
# with open(audio_path, "rb") as f:
|
| 410 |
-
# audio_bytes = f.read()
|
| 411 |
-
|
| 412 |
-
# audio_b64 = base64.b64encode(audio_bytes).decode("utf-8")
|
| 413 |
-
# return audio_b64, duration
|
| 414 |
-
|
| 415 |
#---------------------------concatenate text with tags ---------------------------
|
| 416 |
|
| 417 |
# Map Intensity numbers to tag strings
|
|
|
|
| 395 |
duration: float # seconds
|
| 396 |
audioPath: str
|
| 397 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 398 |
#---------------------------concatenate text with tags ---------------------------
|
| 399 |
|
| 400 |
# Map Intensity numbers to tag strings
|