Spaces:
Sleeping
Sleeping
Commit
·
6a6023c
1
Parent(s):
0cd5c8a
imports
Browse files
app.py
CHANGED
@@ -1,6 +1,8 @@
|
|
|
|
1 |
import json
|
2 |
import os
|
3 |
import requests
|
|
|
4 |
|
5 |
import gradio as gr
|
6 |
import numpy as np
|
@@ -11,9 +13,7 @@ token_str = os.environ['DG_TOKEN']
|
|
11 |
def tts_fn(text, prompt_audio, prompt_seconds, inference_steps, inference_temperature, pitch_steps):
|
12 |
texts = [text]
|
13 |
sr = prompt_audio[0]
|
14 |
-
print(sr)
|
15 |
prompt_audio = prompt_audio[1].astype(np.float32, order='C') / 32768.0
|
16 |
-
print(prompt_audio.shape)
|
17 |
byte_io = io.BytesIO(bytes())
|
18 |
wavfile.write(byte_io, sr, prompt_audio)
|
19 |
prompt_audio_bytes = byte_io.read()
|
|
|
1 |
+
import io
|
2 |
import json
|
3 |
import os
|
4 |
import requests
|
5 |
+
import urllib
|
6 |
|
7 |
import gradio as gr
|
8 |
import numpy as np
|
|
|
13 |
def tts_fn(text, prompt_audio, prompt_seconds, inference_steps, inference_temperature, pitch_steps):
|
14 |
texts = [text]
|
15 |
sr = prompt_audio[0]
|
|
|
16 |
prompt_audio = prompt_audio[1].astype(np.float32, order='C') / 32768.0
|
|
|
17 |
byte_io = io.BytesIO(bytes())
|
18 |
wavfile.write(byte_io, sr, prompt_audio)
|
19 |
prompt_audio_bytes = byte_io.read()
|