Update audio_processing/T2A.py
Browse files- audio_processing/T2A.py +6 -0
audio_processing/T2A.py
CHANGED
@@ -12,13 +12,19 @@ class T2A:
|
|
12 |
if self.inputs is not None:
|
13 |
with torch.no_grad():
|
14 |
output_model = model_mms_tts_eng(**self.inputs)
|
|
|
|
|
15 |
|
16 |
audio = output_model["audio"][0]
|
17 |
|
|
|
|
|
18 |
with BytesIO() as buffer:
|
19 |
sf.write(buffer, audio, SAMPLING_RATE, format='wav')
|
20 |
output = buffer.getvalue() # bytes
|
21 |
|
|
|
|
|
22 |
return output
|
23 |
else:
|
24 |
raise Exception("Input text is None. Please provide text")
|
|
|
12 |
if self.inputs is not None:
|
13 |
with torch.no_grad():
|
14 |
output_model = model_mms_tts_eng(**self.inputs)
|
15 |
+
|
16 |
+
print(f"output_model : {output_model}")
|
17 |
|
18 |
audio = output_model["audio"][0]
|
19 |
|
20 |
+
print(f"audio : {audio}")
|
21 |
+
|
22 |
with BytesIO() as buffer:
|
23 |
sf.write(buffer, audio, SAMPLING_RATE, format='wav')
|
24 |
output = buffer.getvalue() # bytes
|
25 |
|
26 |
+
print(f"output : {output}")
|
27 |
+
|
28 |
return output
|
29 |
else:
|
30 |
raise Exception("Input text is None. Please provide text")
|