Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Export rate information in JSON format #19

Open
photkey opened this issue Oct 18, 2023 · 1 comment
Open

[Feature Request] Export rate information in JSON format #19

photkey opened this issue Oct 18, 2023 · 1 comment

Comments

@photkey
Copy link

photkey commented Oct 18, 2023

In actual use, sometimes certain segments are read too quickly, making it difficult to hear clearly. Therefore, it is requested to export the original srt file in JSON format along with the audio file, which includes the actual reading speed for each text segment. With this JSON file, we can achieve better reading effects by re-editing the video or re-editing the srt text.

srt:

1
00:05:00,400 --> 00:05:15,300
If you want to use the edge-tts command, you can simply run it with the following command:

2
00:05:16,400 --> 00:05:25,300
Note the above requires the installation of the mpv command line player.

json:
In the following example snippets, rate represents the actual reading speed.

{
  "subtitles": [
    {
      "id": "1",
      "text": "If you want to use the edge-tts command, you can simply run it with the following command:",
      "start_time": "00:05:00.400",
      "end_time": "00:05:15.300",
      "rate": 1.8
    },
    {
      "id": "2",
      "text": "Note the above requires the installation of the mpv command line player.",
      "start_time": "00:05:16.400",
      "end_time": "00:05:25.300",
      "rate": 1.2
    }
  ]
}
@photkey
Copy link
Author

photkey commented Oct 18, 2023

I thought about it again, and perhaps a better approach would be to add a parameter that exports only the JSON. In this case, we would only need to read the text once. When encountering text that needs to be read at an accelerated pace, there would be no need to read it again. Additionally, there would be no need to merge all the audio files in the final step. Instead, we would only export a JSON file that contains the rate information. This would make the process more efficient for this particular use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant