los-cocos / cocos

graphic library for games and multimedia, for python language on PC-like hardware
http://los-cocos.github.io/cocos-site/
Other
633 stars 147 forks source link

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

Open Roy911019 opened 3 years ago

Roy911019 commented 3 years ago

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?