Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 17389

Python & VLC. Pitch adjustment speeding up the MP4 files instead of add/remove subtones

$
0
0

My MP4 Karaokê player has an issue when handling pitch adjustment. If I use the VLC player itself, the pitch adjustment runs properly, but, if I do it through Python VLC, it speeds the MP4 Karaokê instead of change it pitch.`

import vlckeyboard.on_press_key("up", self.pitch_up)keyboard.on_press_key("down", self.pitch_down)self.instance = vlc.Instance()self.pitch_adjustments = {}self.current_pitch = 0.0self.original_pitch = 0.0self.instance = vlc.Instance("--no-xlib", "--fullscreen", "--video-on-top", "--zoom=2")# Abre as Músicas no VLC em Tela Cheia e Extendida (preenchida)self.player.set_fullscreen(True)  # Abra o VLC em tela cheiattk.Button(button_frame, text="Tom +", command=self.pitch_up, width=6),ttk.Button(button_frame, text="Tom -", command=self.pitch_down, width=6),self.pitch_label = ctk.CTkLabel(self.root, text="Tom: 0.0", font=("Arial", 14))self.pitch_label.grid(row=7, column=0, padx=10, pady=10, columnspan=6)self.original_pitch = 0.0def adjust_pitch(self, pitch_change):    new_pitch = self.current_pitch + pitch_change    new_rate = current_rate * (2 ** (new_pitch / 12))  # Calculate the new rate based on the pitch change    self.current_pitch = new_pitch    self.update_pitch_label()def pitch_up(self, event=None):    self.adjust_pitch(0.1)def pitch_down(self, event=None):    self.adjust_pitch(-0.1)def update_pitch_label(self):    self.pitch_label.configure(text=f"Tom: {self.current_pitch:.1f}")# Reinicie o VLC e a GUI para o estado inicialdef restore_original_pitch(self):    self.adjust_pitch(self.original_pitch)

Viewing all articles
Browse latest Browse all 17389

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>