Update audio_processing/T2A.py
Browse files- audio_processing/T2A.py +7 -5
audio_processing/T2A.py
CHANGED
@@ -1,7 +1,10 @@
|
|
|
|
|
|
1 |
import torch
|
2 |
import soundfile as sf
|
3 |
-
|
4 |
from io import BytesIO
|
|
|
5 |
|
6 |
SAMPLING_RATE = 16000
|
7 |
|
@@ -10,8 +13,7 @@ class T2A:
|
|
10 |
self.output_model = pipe_tts(input_text)
|
11 |
|
12 |
def get_audio(self):
|
13 |
-
|
14 |
-
|
15 |
synth = self.output_model["audio"][0]
|
16 |
|
17 |
print(f"synth : {synth}")
|
@@ -23,5 +25,5 @@ class T2A:
|
|
23 |
print(f"output : {output}, type : {type(output)}")
|
24 |
|
25 |
return output
|
26 |
-
|
27 |
-
|
|
|
1 |
+
import logging
|
2 |
+
|
3 |
import torch
|
4 |
import soundfile as sf
|
5 |
+
|
6 |
from io import BytesIO
|
7 |
+
from .config import pipe_tts
|
8 |
|
9 |
SAMPLING_RATE = 16000
|
10 |
|
|
|
13 |
self.output_model = pipe_tts(input_text)
|
14 |
|
15 |
def get_audio(self):
|
16 |
+
try:
|
|
|
17 |
synth = self.output_model["audio"][0]
|
18 |
|
19 |
print(f"synth : {synth}")
|
|
|
25 |
print(f"output : {output}, type : {type(output)}")
|
26 |
|
27 |
return output
|
28 |
+
except Exception as e:
|
29 |
+
logging.error(f"Raised an error : {e}")
|