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

Closed

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

Activity

  1. sbc100 commented on Feb 12, 2024

    @sbc100
    Collaborator
  2. sbc100 commented on Feb 12, 2024

    @sbc100
    Collaborator

    Ah.. it seems like this is most likely due to #21013

  3. sbc100 commented on Feb 12, 2024

    @sbc100
    Collaborator

    Hmm .. the test_sdl2_mixer_wav.c test seems to work fine.

  4. added a commit that references this issue on Feb 12, 2024
    8287b4f
  5. added a commit that references this issue on Feb 13, 2024
    0cb21d5
  6. added a commit that references this issue on Feb 23, 2024
    3dc1f2e
  7. added a commit that references this issue on Apr 12, 2024
    baa07c9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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