File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 1
- import json
2
1
import os
3
2
import tempfile
4
3
5
4
import numpy as np
6
5
import pytest
7
6
8
7
from faster_whisper import WhisperModel
8
+ from open_dubbing .utterance import Utterance
9
9
10
10
11
11
class TestCmd :
@@ -34,11 +34,15 @@ def _update_translation(self, directory):
34
34
file .write (text )
35
35
36
36
def _get_utterances (self , directory ):
37
- metadata_file = os .path .join (directory , "utterance_metadata_cat.json" )
38
- with open (metadata_file , encoding = "utf-8" ) as json_data :
39
- data = json .load (json_data )
40
- utterances = data ["utterances" ]
41
- return utterances
37
+ utterance = Utterance (target_language = "cat" , output_directory = directory )
38
+ utterances , _ , _ = utterance .load_utterances ()
39
+ return utterances
40
+
41
+ # metadata_file = os.path.join(directory, "utterance_metadata_cat.json")
42
+ # with open(metadata_file, encoding="utf-8") as json_data:
43
+ # data = json.load(json_data)
44
+ # utterances = data["utterances"]
45
+ # return utterances
42
46
43
47
def _assert_dubbing_action (self , directory ):
44
48
utterances = self ._get_utterances (directory )
You can’t perform that action at this time.
0 commit comments