Spaces:
Sleeping
Sleeping
Try to replace package with package
Browse files- requirements.txt +2 -1
- src/synthesize.py +6 -3
requirements.txt
CHANGED
@@ -9,4 +9,5 @@ IPython
|
|
9 |
TTS
|
10 |
pandas
|
11 |
wave
|
12 |
-
py-espeak-ng
|
|
|
|
9 |
TTS
|
10 |
pandas
|
11 |
wave
|
12 |
+
#py-espeak-ng
|
13 |
+
espeakng
|
src/synthesize.py
CHANGED
@@ -3,7 +3,7 @@ from huggingface_hub.inference_api import InferenceApi
|
|
3 |
import torch
|
4 |
from TTS.api import TTS
|
5 |
import wave
|
6 |
-
|
7 |
import subprocess
|
8 |
from scipy.io import wavfile
|
9 |
from transformers import pipeline
|
@@ -74,8 +74,11 @@ def synth_espeakng(text:str, model:str):
|
|
74 |
'''
|
75 |
if model is not None:
|
76 |
|
77 |
-
subprocess.run(['espeak-ng', f'-v{model}', "-w test.wav", text]) #.returncode
|
78 |
-
|
|
|
|
|
|
|
79 |
sampling_rate, wav = wavfile.read('test.wav')
|
80 |
os.remove("test.wav")
|
81 |
|
|
|
3 |
import torch
|
4 |
from TTS.api import TTS
|
5 |
import wave
|
6 |
+
import espeakng
|
7 |
import subprocess
|
8 |
from scipy.io import wavfile
|
9 |
from transformers import pipeline
|
|
|
74 |
'''
|
75 |
if model is not None:
|
76 |
|
77 |
+
#subprocess.run(['espeak-ng', f'-v{model}', "-w test.wav", text]) #.returncode
|
78 |
+
esng = espeakng.Speaker()
|
79 |
+
esng.voice = model
|
80 |
+
esng.say(text, export_path="test.wav")
|
81 |
+
|
82 |
sampling_rate, wav = wavfile.read('test.wav')
|
83 |
os.remove("test.wav")
|
84 |
|