|
@@ -10,7 +10,7 @@ import tqdm
|
|
|
from .audio import SAMPLE_RATE, N_FRAMES, HOP_LENGTH, pad_or_trim, log_mel_spectrogram
|
|
|
from .decoding import DecodingOptions, DecodingResult
|
|
|
from .tokenizer import LANGUAGES, TO_LANGUAGE_CODE, get_tokenizer
|
|
|
-from .utils import exact_div, format_timestamp, optional_int, optional_float, str2bool, write_vtt, write_srt
|
|
|
+from .utils import exact_div, format_timestamp, optional_int, optional_float, str2bool, write_txt, write_vtt, write_srt
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
from .model import Whisper
|
|
@@ -295,7 +295,7 @@ def cli():
|
|
|
|
|
|
# save TXT
|
|
|
with open(os.path.join(output_dir, audio_basename + ".txt"), "w", encoding="utf-8") as txt:
|
|
|
- print(result["text"], file=txt)
|
|
|
+ write_txt(result["segments"], file=txt)
|
|
|
|
|
|
# save VTT
|
|
|
with open(os.path.join(output_dir, audio_basename + ".vtt"), "w", encoding="utf-8") as vtt:
|