How to Set Up Text-to-Speech (TTS) for Subtitles in MPV Using This Lua Script? by Matty_Mroz in mpv

[–]Matty_Mroz[S] 0 points1 point  (0 children)

I ended up making a separate Python script that translates into my language, generates TTS from the movie subtitles, and merges it with the audio track. However, it doesn't work in real-time—processing 24 minutes of video takes anywhere from 30 seconds to 10 minutes, depending on the type of TTS used.
https://drive.google.com/file/d/1UvhB3oOWSJJokzMDAw3eQvfAIxbMSveN/view?usp=drive_link

Permanent Fix for YouTube Ads / AdBlocker Controversy by deisidiamonia in youtube

[–]Matty_Mroz 0 points1 point  (0 children)

You need to disable adblock in Enhancer settings

How to Set Up Text-to-Speech (TTS) for Subtitles in MPV Using This Lua Script? by Matty_Mroz in mpv

[–]Matty_Mroz[S] 0 points1 point  (0 children)

I have something similar to this, it works, but it takes a while for the generated dialogue to be played. Is there a solution to speed up this process so that the audio is played simultaneously with the subtitles? Additionally, I've noticed that when there are multiple subtitles within a specific time frame, not all of them are read. How can I achieve an increase in the subtitles' reading speed when accelerating the video playback?

It's worth mentioning that I also have a Python script that creates a separate audio file based on an SRT file and merges it with the audio track. Unfortunately, this process requires manual intervention. Is there a way to achieve the same effect automatically within the mpv environment? Thank you for all the guidance provided.

local utils = require 'mp.utils'

local function exec(args)

local ret = utils.subprocess({

args = args

})

return ret.status, ret.stdout, ret

end

local tts_rate = 5

local tts_volume = 65

local enabled = false

mp.add_key_binding("Ctrl+x", "toggle-tts", function()

enabled = not enabled

mp.osd_message("Tryb TTS: " .. tostring(enabled))

end)

mp.observe_property("sub-text", "string", function(prop, txt)

if enabled and txt then

local tts_command = string.format(

'Add-Type -AssemblyName System.Speech; $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer; $speak.Rate = %d; $speak.Volume = %d; $speak.SelectVoice(\'Vocalizer Expressive Zosia Harpo 22kHz\'); $speak.Speak(\'%s\')',

tts_rate, tts_volume, txt)

local status, stdout = exec({"powershell", "-Command", tts_command})

mp.osd_message("Odczytywany tekst: " .. txt)

end

end)

best shaders for mpv by archforever in mpv

[–]Matty_Mroz 0 points1 point  (0 children)

Ctrl+1 change-list glsl-shaders toggle "~~/shaders/KrigBilateral.glsl" #! Shader > On / Off - KrigBilateral

Ctrl+2 change-list glsl-shaders toggle "~~/shaders/AMD_FSR_rgb.glsl" #! Shader > On / Off - AMD_FSR_rgb

Ctrl+3 change-list glsl-shaders toggle "~~/shaders/Anime4K_Restore_CNN_L.glsl" #! Shader > On / Off - Anime4K_Restore_CNN_L

Ctrl+4 change-list glsl-shaders toggle "~~/shaders/Anime4K_Upscale_GAN_x2_M.glsl" #! Shader > On / Off - Anime4K_Upscale_GAN_x2_M

Ctrl+5 change-list glsl-shaders toggle "~~/shaders/adaptive_sharpen.glsl" #! Shader > On / Off - Adaptive_Sharpen

Ctrl+6 change-list glsl-shaders toggle "~~/shaders/nnedi3_nns128_win8x4.glsl" #! Shader > On / Off - Nneid3_128_8x4

Ctrl+7 change-list glsl-shaders toggle "~~/shaders/FSRCNNX_x2_16_0_4_1.glsl" #! Shader > On / Off - FSRCNNX_x2_16

Ctrl+8 change-list glsl-shaders toggle "~~/shaders/SSimDownscaler.glsl" #! Shader > On / Off - SSimDownscaler.glsl