0

I have imported music using pygame and the song is being played, but it is lagging. Here is my code:

import pygame
from Tkinter import *

file = 'OnOurWay.mp3'
root = Tk()
pygame.init()
pygame.mixer.init()
pygame.mixer.music.load(file)
pygame.mixer.music.play()
root.mainloop()
Paradox
  • 4,602
  • 12
  • 44
  • 88
harsh
  • 21
  • 3
  • Why are you using tkinter *and* pygame at the same time? Both are graphical frameworks - pygame can easily produce a window as well. – Chris Aug 23 '16 at 13:48
  • Also, per the Pygame docs, mp3 is not recommended: "Be aware that MP3 support is limited. [...] Consider using OGG instead." http://www.pygame.org/docs/ref/music.html – Chris Aug 23 '16 at 13:49

0 Answers0