Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load SDL2 for cocos.audio.pygame.music #347

Open
Roy911019 opened this issue Aug 27, 2021 · 0 comments
Open

load SDL2 for cocos.audio.pygame.music #347

Roy911019 opened this issue Aug 27, 2021 · 0 comments

Comments

@Roy911019
Copy link


error message


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:/Anaconda3/Lib/site-packages/cocos/audio/pygame/music.py", line 16, in
from cocos.audio.SDL import *
File "D:\Anaconda3\lib\site-packages\cocos\audio\SDL_init_.py", line 30, in
from . import dll as SDL_dll
File "D:\Anaconda3\lib\site-packages\cocos\audio\SDL\dll.py", line 261, in
_dll = SDL_DLL('SDL', 'SDL_Linked_Version', '1.2')
File "D:\Anaconda3\lib\site-packages\cocos\audio\SDL\dll.py", line 62, in init
raise ImportError(('Dynamic library "%s" was not found' %
ImportError: Dynamic library "SDL" was not found

Process finished with exit code 1


codes


import configparser
import os
from cocos.audio.pygame import music
config = configparser.ConfigParser()
File_Path = os.path.abspath(os.path.dirname(os.path.dirname(file)))
def playmusic(music_status = None):
music.load("../resources/music/background.mp3")
if music_status == None:
config.read(File_Path + "/config.ini",encoding="utf-8")
print(File_Path + "/config.ini")
music_status = config.getint("setting","music_status")
print(music_status)
if music_status==1:
music.play()
if name == 'main':
playmusic()


Question


When I use the object music,the error messages show up.For the latest pygame,I check the .dll in pygame is SDL2.dll.
So how what should i do to solve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant