【问题标题】:Audio sound is not working in video of Pygame.It is just like a muted video音频声音在 Pygame 的视频中不起作用。它就像一个静音的视频
【发布时间】:2014-07-06 07:45:31
【问题描述】:

这是我的代码。当我在 Python 2.7 中在 Tkinter 图形模式下借助 abutton 运行它时,它会显示 pygame 电影屏幕但没有声音.....

我也单独试了一下,但是没有声音……

import pygame

FPS = 60

pygame.init()
clock = pygame.time.Clock()
movie = pygame.movie.Movie('1.MPG')
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()

请某人检查一下....

【问题讨论】:

    标签: python python-2.7 audio pygame


    【解决方案1】:

    试试pygame.movie.set_volume(1) wiki

    并检查基本情况:您的扬声器打开了吗? 电影有声音吗?

    【讨论】:

      【解决方案2】:

      据此link:尝试添加

      pygame.mixer.quit()
      

      之前

      movie = pygame.movie.Movie('1.MPG') 
      

      【讨论】:

        猜你喜欢
        • 2016-06-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-03-31
        相关资源
        最近更新 更多