Yehor Smoliakov commited on
Commit
981bcde
1 Parent(s): 4436e8b

Add durations

Browse files
examples/count_duration.py CHANGED
@@ -1,6 +1,20 @@
 
 
 
 
 
 
1
  from datasets import load_dataset
2
 
3
- ds = load_dataset("Yehor/tts-mykyta-uk", "lada")
 
4
 
5
  for row in ds['train']:
6
- print(row)
 
 
 
 
 
 
 
 
1
+ import json
2
+ import warnings
3
+ warnings.filterwarnings('ignore')
4
+
5
+ from os.path import exists
6
+ import librosa
7
  from datasets import load_dataset
8
 
9
+ ds = load_dataset("Yehor/tts-mykyta-uk", "tetiana")
10
+ files_dir = '/home/yehor/ext-ml-disk/tts/tts-mykyta-uk/files/tetiana/dataset_oleksa'
11
 
12
  for row in ds['train']:
13
+ filename = f'{files_dir}/{row["audio"]}'
14
+ if not exists(filename):
15
+ continue
16
+
17
+ duration = librosa.get_duration(path=filename)
18
+ row['duration'] = duration
19
+
20
+ print(json.dumps(row))
voices/kateryna/train.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
voices/lada/train.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
voices/mykyta/train.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
voices/oleksa/train.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
voices/tetiana/train.jsonl CHANGED
The diff for this file is too large to render. See raw diff