music streaming experiment

This commit is contained in:
Anthony Samms
2025-09-13 02:28:55 -04:00
parent 513d6ffa39
commit 647ccbc642
3 changed files with 10 additions and 10 deletions

View File

@@ -857,7 +857,7 @@ class AudioEngine:
if sound in self.sounds:
self.sounds[sound].pan = max(0.0, min(1.0, pan))
def load_music_stream(self, fileName: Path, preview: float=0, normalize: Optional[float] = None) -> str:
def load_music_stream(self, fileName: Path, preview: Optional[float] = None, normalize: Optional[float] = None) -> str:
music = Music(file_path=fileName, target_sample_rate=self.target_sample_rate, preview=preview, normalize=normalize)
music_id = f"music_{len(self.music_streams)}"
self.music_streams[music_id] = music

View File

@@ -23,7 +23,7 @@ class BaseChibi:
self.hori_move.start()
self.vert_move = Animation.create_move(60000 / self.bpm / 2, total_distance=50, reverse_delay=0)
self.vert_move.start()
self.index = random.randint(0, len(tex.textures[self.name])-1)
self.index = random.randint(0, len([item for item in tex.textures[self.name] if item[0].isdigit()])-1)
tex_list = tex.textures[self.name][str(self.index)].texture
keyframe_len = tex_list if isinstance(tex_list, list) else [0]
self.keyframes = [i for i in range(len(keyframe_len))]