Skip to content
Snippets Groups Projects
Commit 229e155c authored by Ahmet Öner's avatar Ahmet Öner
Browse files

Fix JSON serialization of segments due to Faster Whisper v1.1.0 changes

parent 74bf823b
Branches
No related tags found
No related merge requests found
......@@ -4,6 +4,10 @@ Changelog
Unreleased
----------
### Fixed
- Fix JSON serialization of segments due to Faster Whisper v1.1.0 changes
[1.7.0] (2024-12-17)
--------------------
......
import json
import os
from dataclasses import asdict
from typing import TextIO, BinaryIO
import ffmpeg
......@@ -88,6 +89,8 @@ class WriteJSON(ResultWriter):
extension: str = "json"
def write_result(self, result: dict, file: TextIO):
if "segments" in result:
result["segments"] = [asdict(segment) for segment in result["segments"]]
json.dump(result, file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment