forked from zabir-nabil/bangla-tts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bakta_test_results.py
51 lines (37 loc) · 1 KB
/
bakta_test_results.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# python 3.6
# github/zabir-nabil
import os
from config import *
import numpy as np
import tensorflow as tf
from graph import Graph
from data_load import load_data
from scipy.io.wavfile import write
from tqdm import tqdm
import time
import random
import numpy as np
import librosa
import os, copy
from scipy import signal
import requests
import shutil
import wget
import warnings
warnings.filterwarnings("ignore")
import sys, os
from bangla_tts import spectrogram2wav, griffin_lim, invert_spectrogram, upsample2, generate, generate_long
import json
bang_f = json.load(open("test_dataset/bakta_bang.json", encoding='utf-8'))
bangeng_f = json.load(open("test_dataset/bakta_bang_eng.json", encoding='utf-8'))
cnt = 1
for sen in bang_f:
# print(sen)
generate_long(sen["Sentence"], f"test_dataset/results/bangla_tts_bang{cnt}.wav")
cnt += 1
time.sleep(1)
cnt = 1
for sen in bangeng_f:
# print(sen)
generate_long(sen["Sentence"], f"test_dataset/results/bangla_tts_bangeng{cnt}.wav")
cnt += 1