Skip to content

Importing the SDL_mixer with -sUSE_SDL_MIXER=2 seems to cause the error: Mix_Init: no sound/music loaders supported () #21321

@eely-eel17

Description

@eely-eel17

It seems that the current version of emsdk (3.1.53 although it seems not work in 3.1.52 as well) has an error when trying to import the SDL_mixer. I had a C program which used SDL2 and SDL_image which worked fine when compiled with emcc. However, when I add the flag -USE_SDL_MIXER=2, the code would break and the console would have the error: Mix_Init: no sound/music loaders supported () . Reverting to an older version of emsdk (I used 3.1.51 which is the most recent version that works) seemed to fix the issue.

The compile command that I had been using was:emcc source/main.c -o main.html -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s USE_SDL_MIXER=2 -sUSE_OGG=1 -s SDL2_IMAGE_FORMATS=["png"] -s ALLOW_MEMORY_GROWTH=1 --preload-file assets

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions