Pygame sound

2 posts
by Andy_de_jong » Fri Dec 21, 2012 6:22 am

I get video but no sound when I play videos with the pygame command. If I use pygame to play an mp3 I do get sound.

My file is using the MPEG-1 Video Codec and the MP3 Audio Codec.

Can anyone point me to a file that they have successfully played? Is there something wrong in my code?

Code: Select all
import pygame
from time import sleep

screen = pygame.display.set_mode((320,240))"o2.mpg")
if (movie.has_audio()):
    print ("movie has audio")
movie.set_volume (1.0)

I am using Python 2.7.3rc2 and 2012-10-28-wheezy-rasbian
Posts: 2
Joined: Thu Dec 20, 2012 1:44 pm
by Andy_de_jong » Sun Dec 23, 2012 8:00 pm
There was something wrong in my code. I found the following example file which shows the correct method. /usr/share/pyshared/pygame/examples/

pygame.mixer.quit () needed to be before ("o2.mpg")
Posts: 2
Joined: Thu Dec 20, 2012 1:44 pm