1

I'm trying to play a short movieclip at the beggining of a game.I have tried to load and play a few movieclips,but ther's always the same problem:the movie loads and plays,but i never hear the sounds of the movies. Here's the code i had run several times with different mpeg-1 files:

import pygame

pygame.init()
FPS = 60


clock = pygame.time.Clock()
movie = pygame.movie.Movie("StarTrek's Monologue.mpeg")
screen = pygame.display.set_mode(movie.get_size())
movie_screen = pygame.Surface(movie.get_size()).convert()

movie.set_display(movie_screen)
movie.play()


playing = True
while playing:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            movie.stop()
            playing = False

    screen.blit(movie_screen,(0,0))
    pygame.display.update()
    clock.tick(FPS)

pygame.quit()

I'm using Windows XP,python 2.7.8 and the coresponding version of pygame.I know pygame loads only mpeg-1 movie files,but as i said,i dont hear any sounds.Do i have to use something else like pymedia or pyglet for this?

Jon Clements
  • 138,671
  • 33
  • 247
  • 280
  • Relevant link: http://stackoverflow.com/questions/13649884/play-music-using-pygame-but-no-sound – WGS Aug 15 '14 at 20:36

1 Answers1

1

You simply need to add
pygame.mixer.quit()
before
movie = pygame.movie.Movie("StarTrek's Monologue.mpeg") (link)

NorthCat
  • 9,643
  • 16
  • 47
  • 50