2016-12-18 18 views
1

OS X 버전. 10.11.6;파이 게임 : pygame.error : 파일을 열 수 없습니다. .ogg

Python3 ver. stable 3.5.2 (bottled), devel 3.6.0rc1, HEAD (~ 홈 브루 통해);

파이 게임 ver. homebrew/python/pygame: stable 1.9.2a0, HEAD (pipe3홈 브루 모두 아래와 같은 오류가 발생합니다.);

Xcode ver. Xcode 8.2Build version 8C38.

터미널 에 나는 실행 (BattleCity.py)는 게임 소스 코드입니다

python3 BattleCity.py

, 및 모듈이 그것에서 가져온 파이 게임을.

은 다음 터미널의 결과입니다 : (/ 일부 보이지 않는 문자를 제거 가독성을 위해 내가 들여 쓰기를 재 배열을 추가했습니다)

2016-12-18 21:26:12.739 Python[1600:53113] 21:26:12.739 
WARNING:140: 
This application, or a library it uses, is using the deprecated Carbon Component 
Manager for hosting Audio Units. 

Support for this will be removed in a future release. 

Also, this makes the host incompatible with version 3 audio units. 

Please transition to the API's in AudioComponent.h. 

Traceback (most recent call last): 
    File "BattleCity.py", line 2074, in <module> 
    game = Game() 
    File "BattleCity.py", line 1266, in __init__ 
    sounds["start"] = pygame.mixer.Sound("sounds/gamestart.ogg") 
pygame.error: Unable to open file 'sounds/gamestart.ogg' 

나는 몇 가지 관련 질문 그러나 그들의 솔루션을 통해 검색 한 일하지 마.

pygame.init() 파일을 사용했지만 위의 두 오류가 관련되어 있는지 궁금해하므로 여전히 동일한 오류가 있습니까?

답변

0

a post on Reddit이 솔루션은 .ogg 음악 파일을 재생하는 데 완벽하게 작동합니다.

당신이 브루를 사용하는 경우, 터미널에 다음을 입력 : 당신이 sol_mixer를 설치 한 경우 이

brew install libogg 
brew install libvorbis 
brew install sdl_mixer --with-libvorbis 

(나는 다음과 같은 코드를 실행하기 전에, 내가 brew list 아래의 하나를 설치 한 여부를 확인) 및 프로그램은 여전히 ​​(예, 그것은 또한 나를 위해하지 않았다) 작동하지 않습니다

시도 :

brew reinstall sdl_mixer --with-libvorbis