the fire alarm went off so I need to commit

This commit is contained in:
Yonokid
2025-06-01 16:08:45 -04:00
parent 2a6278943b
commit 190b8cf352
12 changed files with 1743 additions and 643 deletions

View File

@@ -1,3 +1,5 @@
from pathlib import Path
import pyray as ray
from moviepy import VideoFileClip
@@ -6,14 +8,14 @@ from libs.utils import get_current_ms
class VideoPlayer:
def __init__(self, path: str):
def __init__(self, path: Path):
"""Initialize a video player instance. Audio must have the same name and an ogg extension.
Todo: extract audio from video directly
"""
self.is_finished_list = [False, False]
self.video_path = path
self.video = VideoFileClip(path)
audio_path = path[:-4] + '.ogg'
audio_path = path.with_suffix('.ogg')
self.audio = audio.load_music_stream(audio_path)
self.buffer_size = 10 # Number of frames to keep in memory